diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-26 22:32:51 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-26 22:32:51 +0000 |
commit | bd881992dc226e9e618e928d723863494e32c660 (patch) | |
tree | 4ab095b755e11bdca971d1ee0b306a5ff2acff6f /gcc/alias.c | |
parent | 4acc436ee5af88f8df9cf2295935f3c065d29a89 (diff) | |
download | gcc-bd881992dc226e9e618e928d723863494e32c660.tar.gz |
* alias.c (objects_must_conflict_p): Read-only slots may not
conflict despite having the same type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index 6e92533a098..85bce38c70f 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -309,21 +309,24 @@ int objects_must_conflict_p (t1, t2) tree t1, t2; { + /* If one or the other has readonly fields or is readonly, + then they may not conflict. */ + if ((t1 != 0 && readonly_fields_p (t1)) + || (t2 != 0 && readonly_fields_p (t2)) + || (t1 != 0 && TYPE_READONLY (t1)) + || (t2 != 0 && TYPE_READONLY (t2))) + return 0; + /* If they are the same type, they must conflict. */ if (t1 == t2 /* Likewise if both are volatile. */ || (t1 != 0 && TYPE_VOLATILE (t1) && t2 != 0 && TYPE_VOLATILE (t2))) return 1; - /* We now know they are different types. If one or both has readonly fields - or if one is readonly and the other not, they may not conflict. - Likewise if one is aggregate and the other is scalar. */ - if ((t1 != 0 && readonly_fields_p (t1)) - || (t2 != 0 && readonly_fields_p (t2)) - || ((t1 != 0 && TYPE_READONLY (t1)) - != (t2 != 0 && TYPE_READONLY (t2))) - || ((t1 != 0 && AGGREGATE_TYPE_P (t1)) - != (t2 != 0 && AGGREGATE_TYPE_P (t2)))) + /* 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; /* Otherwise they conflict only if the alias sets conflict. */ |