aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-09-11 19:43:02 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-09-11 19:43:02 +0000
commitfa89b6ecba4ce9448b82a21f91b360eacf57bc72 (patch)
tree6794bfdde0fa3a761d0a915bf86007b0ca87d7e2 /gcc/tree-ssa-structalias.c
parent868eaa1f422576b092cc1bdcf576d4cfa3d18fb3 (diff)
downloadgcc-fa89b6ecba4ce9448b82a21f91b360eacf57bc72.zip
gcc-fa89b6ecba4ce9448b82a21f91b360eacf57bc72.tar.gz
gcc-fa89b6ecba4ce9448b82a21f91b360eacf57bc72.tar.bz2
tree-ssa-structalias.c (push_fields_onto_fieldstack): Deal with TYPE_NONALIASED_COMPONENT like with DECL_NONADDRESSABLE_P.
* 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. From-SVN: r128391
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 a379e7e..3e588bd 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