https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99621
--- Comment #7 from William Bader <williambader at hotmail dot com> --- >Are you sure this just isn't an excess precision problem in all the floating >point calculations? I am pretty sure that it isn't a precision problem because the original program is parsing numbers from postscript, and they are all in a reasonable range between 0 and 3000 with at most 4 decimal places. >-mfpmath=sse -msse2 makes it go away, -fexcess-precision=standard too. >Why is 5167 bad but both 4806 and 5749 I'm getting with other options are good? The original program makes list with the starting Y position of each line. The buffer ends up 4287 when it runs correctly and 5167 when it fails. I cut the program down with creduce, targeting 5167. creduce eliminated the saves of Y position to the buffer. I don't think that it is a precision problem because the output would still work if it was off by a little bit. Also, the original program works correctly with -m32 and -m64 with various options and with clang with various options. If fails only with gcc -m32 -O2. A precision problem would probably give different results with different optimization levels, different architectures, or different compilers. Also, the original program has an #if that calls an empty function. Enabling that call makes it work with gcc -m32 -O2. I think that is a strong sign that it is not a precision error. If you want, I can post the program before I fed it to creduce. It is 962 lines and is human-readable.