https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80802
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Using 'volatile' to force -ffloat-store for 'scaled' helps in the following loop: // Try to find n such that value * 10^n is an integer int32_t n = -1; volatile double scaled; // make sure scaled is in memory to avoid excess pre cision with x87 math for (int32_t i = 0; i < UPRV_LENGTHOF(gPower10); ++i) { scaled = value * gPower10[i]; if (scaled > MAX_INT64_IN_DOUBLE || scaled < -MAX_INT64_IN_DOUBLE) { break; } if (scaled == floor(scaled)) { n = i; break; } }