Attached (hopefully) is a C program that performs a simple floating point calculation that produces a number very close to an integer. When this calculation is done twice within the same program, two different answers are produced if there is an intervening print statement and -O2 or greater optimization. Problem appears with gcc 2.9 through 3.4.2 and Pentiums 1 - 4. Not seen on AMD or Sparcs. I have examined the FPU IEEE rounding control bits but see no difference between the two sections.
Created attachment 7656 [details] .c, .i, .s, .o and x86 executeable. Test suite.
*** This bug has been marked as a duplicate of 323 *** *** This bug has been marked as a duplicate of 323 ***
Created attachment 7658 [details] gcc -v output Output from the compile. Seems normal.