This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A gcc-cris bug?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]