[Bug tree-optimization/80802] [7/8 Regression] VRP triggers (causes) a miscompile in icu4c 58.2
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 17 11:44:00 GMT 2017
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;
}
}
More information about the Gcc-bugs
mailing list