A gcc-cris bug?

Richard Guenther richard.guenther@gmail.com
Wed Oct 6 11:46:00 GMT 2004


On Wed, 6 Oct 2004 12:15:27 +0200, Tal Agmon <tal.agmon@nsc.com> wrote:

> The source code is:
> ------------------------------------------------------
> #include <stdio.h>
> int foo=100;
> 
> int f ()
> {
>   foo = 0;
> }
> 
> void main ()
> {
>   int i;
> 
>   for (i = 0; i < foo; i++)
>     {
>       f ();
>     }
>   printf("foo is: %d, i is: %d\n",foo,i);
> }
> ------------------------------------------------------
> The output should be:
> 
> foo is: 0, i is: 0

no, it clearly should be

foo is: 0, i is: 1

Richard.



More information about the Gcc mailing list