https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126521

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <[email protected]>:

https://gcc.gnu.org/g:6e7cf1f7a5f59c033176fcd7074af53d01ad75ea

commit r17-4952-g6e7cf1f7a5f59c033176fcd7074af53d01ad75ea
Author: Roger Sayle <[email protected]>
Date:   Wed Oct 7 09:41:46 2026 +0100

    PR rtl-optimization/126521: Don't generate ABS in RTL ifcvt with NaNs.

    This patch addresses PR rtl-optimization/126521 where ifcvt transforms
    x < 0 ? -x : x (and x < 0 ? x : -x) into ABS (and FABS respectively).
    Unfortunately, these transformations are unsafe in the presence of NaNs.
    The simple fix is a one-line change to noce_try_abs.

    2026-10-07  Roger Sayle  <[email protected]>

    gcc/ChangeLog
            PR rtl-optimization/126521
            * ifcvt.cc (noce_try_abs): These conversions are unsafe in the
            presence of NaNs.

    gcc/testsuite/ChangeLog
            PR rtl-optimization/126521
            * gcc.target/i386/pr126521.c: New test case.

Reply via email to