From dacdc68f3bd5e7c4de0dd54f9dcb1465686ac01a Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 2 Feb 2018 18:09:58 +0000 Subject: [PATCH] decl.c (array_type_has_nonaliased_component): Return false if the component type is a pointer. * gcc-interface/decl.c (array_type_has_nonaliased_component): Return false if the component type is a pointer. From-SVN: r257344 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/decl.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index aa69c9216fc..e0e72a7d954 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-02-02 Eric Botcazou + + * gcc-interface/decl.c (array_type_has_nonaliased_component): Return + false if the component type is a pointer. + 2018-01-11 Gary Dismukes * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index e8c48c7157a..e0466f349c3 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -6113,6 +6113,11 @@ array_type_has_nonaliased_component (tree gnu_type, Entity_Id gnat_type) return TYPE_NONALIASED_COMPONENT (gnu_parent_type); } + /* Consider that an array of pointers has an aliased component, which is + sort of logical and helps with Taft Amendment types in LTO mode. */ + if (POINTER_TYPE_P (TREE_TYPE (gnu_type))) + return false; + /* Otherwise, rely exclusively on properties of the element type. */ return type_for_nonaliased_component_p (TREE_TYPE (gnu_type)); } -- 2.30.2