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]

A gcc-cris bug?


Hi,

Can someone please check the following test on gcc-3.4.2, target=cris, 
using -O3?
I believe it will expose a gcc bug.
Currently it produces a bug on the crx architecture which is not an 
official part
of gcc, I don't have the full cris toolchain but I created the compiler 
and I see
a similar problem gets reproduced. 

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

Regards,
      Tal Agmon

Software Engineer                          phone: +49-8141-35-1396
CompactRISC Development Tools  fax:        fax:   +49-8141-35-11-1396
National Semiconductor GmbH              mailto:Tal.Agmon@nsc.com
Livry-Gargan Str. 10                       internet: 
http://www.national.com
82256 Fuerstenfeldbruck, Germany


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