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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Andrew Pinski
<pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:ac96973150b3279fe157f160efd83995077c7590

commit r13-8420-gac96973150b3279fe157f160efd83995077c7590
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Sun Mar 10 22:17:09 2024 +0000

    Fold: Fix up merge_truthop_with_opposite_arm for NaNs [PR95351]

    The problem here is that merge_truthop_with_opposite_arm would
    use the type of the result of the comparison rather than the operands
    of the comparison to figure out if we are honoring NaNs.
    This fixes that oversight and now we get the correct results in this
    case.

    Committed as obvious after a bootstrap/test on x86_64-linux-gnu.

            PR middle-end/95351

    gcc/ChangeLog:

            * fold-const.cc (merge_truthop_with_opposite_arm): Use
            the type of the operands of the comparison and not the type
            of the comparison.

    gcc/testsuite/ChangeLog:

            * gcc.dg/float_opposite_arm-1.c: New test.

    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
    (cherry picked from commit 31ce2e993d09dcad1ce139a2848a28de5931056d)

Reply via email to