summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-11 19:43:02 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-11 19:43:02 +0000
commit9ba1ed5a8ff65cefe456fbdd48b7244800de1f87 (patch)
tree6794bfdde0fa3a761d0a915bf86007b0ca87d7e2 /gcc/tree-ssa-structalias.c
parentd2d8f66232a3fcc744de1107058fc3075769f795 (diff)
downloadgcc-9ba1ed5a8ff65cefe456fbdd48b7244800de1f87.tar.gz
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Deal with
TYPE_NONALIASED_COMPONENT like with DECL_NONADDRESSABLE_P. ada/ * decl.c (array_type_has_nonaliased_component): New predicate. (gnat_to_gnu_field) <E_Array_Type>: Invoke the above predicate to set the TYPE_NONALIASED_COMPONENT flag on the type. <E_Array_Subtype>: Likewise. * gigi.h (type_for_nonaliased_component_p): Declare. * utils.c (type_for_nonaliased_component_p): New predicate. (create_field_decl): Invoke the above predicate to set the DECL_NONADDRESSABLE_P flag on the field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128391 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index a379e7e2a8d..3e588bdfcdb 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4114,7 +4114,9 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
else if (!(pushed = push_fields_onto_fieldstack
(TREE_TYPE (type), fieldstack,
offset + i * TREE_INT_CST_LOW (elsz), has_union,
- TREE_TYPE (type))))
+ (TYPE_NONALIASED_COMPONENT (type)
+ ? addressable_type
+ : TREE_TYPE (type)))))
/* Empty structures may have actual size, like in C++. So
see if we didn't push any subfields and the size is
nonzero, push the field onto the stack */
@@ -4129,7 +4131,10 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
pair->size = elsz;
pair->decl = NULL_TREE;
pair->offset = offset + i * TREE_INT_CST_LOW (elsz);
- pair->alias_set = -1;
+ if (TYPE_NONALIASED_COMPONENT (type))
+ pair->alias_set = get_alias_set (addressable_type);
+ else
+ pair->alias_set = -1;
count++;
}
else