This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/80802] [7/8 Regression] VRP triggers (causes) a miscompile in icu4c 58.2


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;
        }
    }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]