looping problem with 19991221 snapshot on Linux/Intel

Paul Kimoto kimoto@lightlink.com
Wed Dec 22 15:54:00 GMT 1999


I am trying the 19991221 snapshot on Linux/i586,
with glibc-2.1.2 (as provided by Debian).

With -O0, count() returns 17 (this is okay);
but with -O1, count() returns 7 (this is not).
 
/* begin C code */
 
static double g (double);

int
count (void)
{
   double x;
   int count = 0;

   for (x = 0.0; x <= 1.0; x += 0.0625) {
      g(g(x));
      count++;
   }

   return count;
}

static double
g (double x)
{
   return x;
}

/* end C code */
 
        -Paul <kimoto@lightlink.com>


More information about the Gcc-bugs mailing list