This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: FAIL: gcc.c-torture/execute/950628-1.c execution, -O1
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Subject: Re: FAIL: gcc.c-torture/execute/950628-1.c execution, -O1
- From: Richard Henderson <rth at redhat dot com>
- Date: Fri, 26 Jan 2001 14:34:57 -0800
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <10101262209.AA14683@vlsi1.ultra.nyu.edu>
On Fri, Jan 26, 2001 at 05:08:31PM -0500, Richard Kenner wrote:
> I have a patch for objects_must_conflict_p to do that, but have been
> waiting to see how the discussion resolves before doing anything with it.
>
> I guess that's reasonable.
Ok. I've now committed the following.
Bootstrapped on alphaev6-linux, and eyeballed the pa testcase
that started this thread.
r~
* alias.c (objects_must_conflict_p): Read-only slots may not
conflict despite having the same type.
Index: alias.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/alias.c,v
retrieving revision 1.114
diff -c -p -d -r1.114 alias.c
*** alias.c 2001/01/19 18:04:23 1.114
--- alias.c 2001/01/26 21:54:55
*************** int
*** 309,329 ****
objects_must_conflict_p (t1, t2)
tree t1, t2;
{
/* 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))))
return 0;
/* Otherwise they conflict only if the alias sets conflict. */
--- 309,332 ----
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;
! /* 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. */