This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 2 new testcases
- To: rth at cygnus dot com
- Subject: Re: 2 new testcases
- From: hjl at lucon dot org (H.J. Lu)
- Date: Wed, 1 Jul 1998 07:29:11 -0700 (PDT)
- Cc: egcs-patches at cygnus dot com
>
> On Tue, Jun 30, 1998 at 08:35:05PM -3100, H.J. Lu wrote:
> > --- /dev/null Wed Dec 31 16:00:00 1969
> > +++ execute/980630-1.c Tue Jun 30 20:07:49 1998
> > @@ -0,0 +1,17 @@
> > +long A [2] = {0};
> > +long B [2] = {2, 0};
> > +
> > +main ()
> > +{
> > + unsigned int i;
> > + long long u;
> > + for (i = 0; i < 2; i+=2)
> > + {
> > + u = A [i] + B [i];
> > + u = (long long) (*(((long *)&( u ))+1)) + A [i+1] + B [i+1];
>
> This line will fail with big endian or -fstrict-aliasing.
>
Ooops. I forgot about endian. We can move it to gcc.dg and
test it on little endian machines only, like x86. As for
-fstrict-aliasing, I have submitted a patch for the bug.
It works with -fstrict-aliasing.
--
H.J. Lu (hjl@gnu.org)