A gcc-cris bug?

Dave Korn dk@artimi.com
Wed Oct 6 15:59:00 GMT 2004


> -----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.

  I guess it just goes to show that a dynamically-varying loop bound is a
pretty rare programming idiom, or people would have run up against this more
often before.......

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Gcc mailing list