A gcc-cris bug?

Richard Guenther richard.guenther@gmail.com
Thu Oct 7 10:30:00 GMT 2004


On Wed, 6 Oct 2004 16:32:58 +0100, Dave Korn <dk@artimi.com> wrote:
> > -----Original Message-----
> > From: Andrew Pinski
> > Sent: 06 October 2004 15:57
> 
> > Another example which has the same bug in 3.4 and before:
> > void main ()
> > {
> >    int i;
> >
> >    for (i = 0; i < foo; i++)
> >      {
> >        foo = 0;
> >      }
> >    printf("foo is: %d, i is: %d\n",foo,i);
> > }
> >
> > so I just provided it has nothing to do with the inliner at all.
> >
> 
>   Yep, and it even works (or rather, doesn't work) if you make foo a local
> variable.  And it goes wrong at -O2 as well as -O3.  But -fno-loop-optimize
> stops it.

Using unsigned int for i fixes the problem as well.

Richard.



More information about the Gcc mailing list