diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-07 07:25:36 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-07 07:25:36 +0000 |
commit | 2bedf2330204415800de2f3bcc7b63ea44687d5f (patch) | |
tree | 5fff45cca9b698baed174e43aec9e69d95e5845a /gcc/alias.c | |
parent | b8ca31ed508b22fe0c0bb6f8301ba98918119db1 (diff) | |
download | gcc-2bedf2330204415800de2f3bcc7b63ea44687d5f.tar.gz |
PR optimization/11198
* alias.c (objects_must_conflict_p): Return 1 if the types have
the same alias set, not if the alias sets only conflict.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69034 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index c68a0ad10b9..2617c8b5e71 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -317,6 +317,8 @@ readonly_fields_p (tree type) int objects_must_conflict_p (tree t1, tree t2) { + HOST_WIDE_INT set1, set2; + /* If neither has a type specified, we don't know if they'll conflict because we may be using them to store objects of various types, for example the argument and local variables areas of inlined functions. */ @@ -337,15 +339,15 @@ objects_must_conflict_p (tree t1, tree t2) || (t1 != 0 && TYPE_VOLATILE (t1) && t2 != 0 && TYPE_VOLATILE (t2))) return 1; - /* If one is aggregate and the other is scalar then they may not - conflict. */ - if ((t1 != 0 && AGGREGATE_TYPE_P (t1)) - != (t2 != 0 && AGGREGATE_TYPE_P (t2))) - return 0; + set1 = t1 ? get_alias_set (t1) : 0; + set2 = t2 ? get_alias_set (t2) : 0; - /* Otherwise they conflict only if the alias sets conflict. */ - return alias_sets_conflict_p (t1 ? get_alias_set (t1) : 0, - t2 ? get_alias_set (t2) : 0); + /* Otherwise they conflict if they have no alias set or the same. We + can't simply use alias_sets_conflict_p here, because we must make + sure that every subtype of t1 will conflict with every subtype of + t2 for which a pair of subobjects of these respective subtypes + overlaps on the stack. */ + return set1 == 0 || set2 == 0 || set1 == set2; } /* T is an expression with pointer type. Find the DECL on which this |