alias.c (objects_must_conflict_p): Read-only slots may not conflict despite having...
authorRichard Henderson <rth@redhat.com>
Fri, 26 Jan 2001 22:32:51 +0000 (14:32 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 26 Jan 2001 22:32:51 +0000 (14:32 -0800)
        * alias.c (objects_must_conflict_p): Read-only slots may not
        conflict despite having the same type.

From-SVN: r39285

gcc/ChangeLog
gcc/alias.c

index c2dcc4e422e3c1172f7647030b2edbb2b7742e07..1441a6f49f15366a4dcbe6141c46696d35aff2cb 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-26  Richard Henderson  <rth@redhat.com>
+
+       * alias.c (objects_must_conflict_p): Read-only slots may not
+       conflict despite having the same type.
+
 2001-01-27  Michael Hayes  <mhayes@redhat.com>
 
        * loop.c (loop_giv_reduce_benefit): Copy mode size into
index 6e92533a0989bb09543733489332adfe4555adde..85bce38c70f0fd80e1d47d9cf256280a05abeccd 100644 (file)
@@ -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. */