https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87128
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- 1e23 is outside the range where all integers can be represented exactly by a 64-bit IEEE double, and the calculation is imprecise when using i387 floating point registers. The expected answer is given when using: -ffloat-store or when using: -msse -mfpmath=sse -fexcess-precision=standard