This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/80802] [7/8 Regression] VRP triggers (causes) a miscompile in icu4c 58.2
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 May 2017 11:07:31 +0000
- Subject: [Bug tree-optimization/80802] [7/8 Regression] VRP triggers (causes) a miscompile in icu4c 58.2
- Auto-submitted: auto-generated
- References: <bug-80802-4@http.gcc.gnu.org/bugzilla/>
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;
}
}