This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove broken testcase gcc.c-torture/execute/20020619-1.c
- From: Richard Guenther <rguenther at suse dot de>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Jun 2008 10:31:05 +0200 (CEST)
- Subject: Re: [PATCH] Remove broken testcase gcc.c-torture/execute/20020619-1.c
- References: <Pine.LNX.4.64.0805291321010.26762@zhemvz.fhfr.qr> <m3d4mntbcq.fsf@google.com>
On Wed, 11 Jun 2008, Ian Lance Taylor wrote:
> Richard Guenther <rguenther@suse.de> writes:
>
> > Maybe I'm missing something obvious, but the testcase
> > gcc.c-torture/execute/20020619-1.c invokes undefined behavior in
> > test(), as *(int *)c references c through an incompatible lvalue.
> >
> > In particular 6.5/7 doesn't make the object type special, but only
> > the lvalue type. And the effective type of c is char (its declared
> > type). And clearly char and int are not compatible either.
> >
> > But well... ok for mainline? (this is the single testcase that
> > "breaks" if we fix PR36345, the TBAA-pruning of points-to sets)
>
> For what it's worth, that test case was added here, without a
> ChangeLog entry:
>
> http://gcc.gnu.org/ml/gcc-patches/2002-06/msg01730.html
>
> Interestingly, the invalid part of the test is not what Richard
> Henderson was actually trying to test. He was fixing a bug which
> caused ref to return the wrong value, and wrote test to try to get the
> endian-independent value which ref was supposed to return.
>
> It would probably suffice to change main to check that ref returns
> either 0x01020304 or 0x04030201.
Ok, I'll make an adjustment according to that.
Thanks,
Richard.