aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-08-12 15:10:47 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-08-12 15:10:47 +0000
commitdaad02781a10022ac810312c46fda483809c3634 (patch)
tree637efc702dde071c504b6d68951b06bfb3f2b5c1 /gcc/alias.c
parent30de16328a546dd06011235d86ef573dc2ffba6e (diff)
downloadgcc-daad02781a10022ac810312c46fda483809c3634.zip
gcc-daad02781a10022ac810312c46fda483809c3634.tar.gz
gcc-daad02781a10022ac810312c46fda483809c3634.tar.bz2
alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P.
2009-08-12 Richard Guenther <rguenther@suse.de> * alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P. * gimplify.c (gimplify_modify_expr): Do not use lang_hooks.types_compatible_p. * tree-ssa.c (useless_type_conversion_p): For aggregates just return false if the canonical types differ. From-SVN: r150695
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 442be82..eaa127e 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -680,11 +680,20 @@ get_alias_set (tree t)
}
/* Variant qualifiers don't affect the alias set, so get the main
- variant. Always use the canonical type as well.
- If this is a type with a known alias set, return it. */
+ variant. */
t = TYPE_MAIN_VARIANT (t);
- if (TYPE_CANONICAL (t))
- t = TYPE_CANONICAL (t);
+
+ /* Always use the canonical type as well. If this is a type that
+ requires structural comparisons to identify compatible types
+ use alias set zero. */
+ if (TYPE_STRUCTURAL_EQUALITY_P (t))
+ return 0;
+ t = TYPE_CANONICAL (t);
+ /* Canonical types shouldn't form a tree nor should the canonical
+ type require structural equality checks. */
+ gcc_assert (!TYPE_STRUCTURAL_EQUALITY_P (t) && TYPE_CANONICAL (t) == t);
+
+ /* If this is a type with a known alias set, return it. */
if (TYPE_ALIAS_SET_KNOWN_P (t))
return TYPE_ALIAS_SET (t);