This is the mail archive of the gcc-bugs@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]

miscompiled loop condition



November 25 CVS sources

In this test case the expression in the while condition gets
miscompiled with -O2 on i386 and sparc.  The result is that the
program loops endlessly when it is run.


double x, y;

int
main()
{
  x = 2.0;
  y = x;
  do
    {
      x = y;
      y = 2.0 * y;
    }
  while ( ! ((y - x) >= 20));
}


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