[Bug tree-optimization/104389] [10/11/12 Regression] HUGE_VAL * 0.0 is no longer a NaN

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Feb 5 09:54:17 GMT 2022


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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r12-7072-gb3763384a1f696260f3ee7bda8c0e7e4ad732ad9
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Feb 5 10:52:19 2022 +0100

    match.pd: Fix x * 0.0 -> 0.0 folding [PR104389]

    The recent PR95115 change to punt in const_binop on folding operation
    with non-NaN operands into NaN if flag_trapping_math broke the following
    testcase, because the x * 0.0 simplification punts just if
    x maybe a NaN (because NaN * 0.0 is NaN not 0.0) or if one of the operands
    could be negative zero.  But Inf * 0.0 or -Inf * 0.0 is also NaN, not
    0.0, so when NaNs are honored we need to punt for possible infinities too.

    2022-02-05  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/104389
            * match.pd (x * 0 -> 0): Punt if x maybe infinite and NaNs are
            honored.

            * gcc.dg/pr104389.c: New test.


More information about the Gcc-bugs mailing list