[Bug middle-end/106805] Undue optimisation of floating-point comparisons

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 18 07:31:35 GMT 2024


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

--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:030186cabe8128e752619e101768cf8823a42c38

commit r15-2132-g030186cabe8128e752619e101768cf8823a42c38
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Thu Jul 18 08:27:36 2024 +0100

    Implement a -ftrapping-math/-fsignaling-nans TODO in match.pd.

    I've been investigating some (float)i == CST optimizations for match.pd,
    and noticed there's already a TODO comment in match.pd that's relatively
    easy to implement.  When CST is a NaN, we only need to worry about
    exceptions with flag_trapping_math, and equality/inequality tests for
    sNaN only behave differently to qNaN with -fsignaling-nans.  These
    issues are related to PR 57371 and PR 106805 in bugzilla.

    2024-07-18  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            * match.pd ((FTYPE) N CMP CST): Only worry about exceptions with
            flag_trapping_math, and about signaling NaNs with HONOR_SNANS.

    gcc/testsuite/ChangeLog
            * c-c++-common/pr57371-4.c: Update comment.
            * c-c++-common/pr57371-5.c: Add missing testcases from pr57371-4.c
            and update for -fno-signaling-nans -fno-trapping-math.


More information about the Gcc-bugs mailing list