diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-02-05 10:52:19 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-02-05 10:53:54 +0100 |
commit | b3763384a1f696260f3ee7bda8c0e7e4ad732ad9 (patch) | |
tree | febcce6fffe8b8fa9fac9d643ba784416217f0b9 /gcc/gimple-expr.cc | |
parent | affdeda16ef7fbd34f850443fe63bb407714297e (diff) | |
download | gcc-b3763384a1f696260f3ee7bda8c0e7e4ad732ad9.zip gcc-b3763384a1f696260f3ee7bda8c0e7e4ad732ad9.tar.gz gcc-b3763384a1f696260f3ee7bda8c0e7e4ad732ad9.tar.bz2 |
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.
Diffstat (limited to 'gcc/gimple-expr.cc')
0 files changed, 0 insertions, 0 deletions