summaryrefslogtreecommitdiffstats
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-19 15:36:05 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-19 15:36:05 +0000
commitb35a8f4864f6fdabc2a47ad3c650248bbc6a4be7 (patch)
tree9af82af05ff6db994ce02d04b87bc63d05a986ad /gcc/alias.c
parentc543e20e9160b14b98a82e563881796f6b7283f5 (diff)
downloadppe42-gcc-b35a8f4864f6fdabc2a47ad3c650248bbc6a4be7.tar.gz
ppe42-gcc-b35a8f4864f6fdabc2a47ad3c650248bbc6a4be7.zip
2007-10-19 Richard Guenther <rguenther@suse.de>
PR middle-end/33816 PR middle-end/32921 * stor-layout.c (layout_type): Assert that aggregates do not have their alias sets set. * alias.c (get_alias_set): Return alias set zero for incomplete types, return the alias set of the element for incomplete array types, but do not remember these. * gfortran.dg/pr32921.f: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129491 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 1ba1ce366d8..6bf67f3574f 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -611,6 +611,18 @@ get_alias_set (tree t)
if (TYPE_ALIAS_SET_KNOWN_P (t))
return TYPE_ALIAS_SET (t);
+ /* We don't want to set TYPE_ALIAS_SET for incomplete types. */
+ if (!COMPLETE_TYPE_P (t))
+ {
+ /* For arrays with unknown size the conservative answer is the
+ alias set of the element type. */
+ if (TREE_CODE (t) == ARRAY_TYPE)
+ return get_alias_set (TREE_TYPE (t));
+
+ /* But return zero as a conservative answer for incomplete types. */
+ return 0;
+ }
+
/* See if the language has special handling for this type. */
set = lang_hooks.get_alias_set (t);
if (set != -1)
OpenPOWER on IntegriCloud