aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToru Kisuki <tkisuki@tachyum.com>2023-06-19 11:51:09 -0600
committerJeff Law <jlaw@ventanamicro.com>2023-06-19 11:53:11 -0600
commit827b2a279fc6ad5bb76e4d2c2eb3432955b5e11c (patch)
tree68b8158bbe9352f496f44bc369621ee5f9f9ab91
parent7b34cacc5735385e7e2855d7c0a6fad60ef4a99b (diff)
downloadgcc-827b2a279fc6ad5bb76e4d2c2eb3432955b5e11c.zip
gcc-827b2a279fc6ad5bb76e4d2c2eb3432955b5e11c.tar.gz
gcc-827b2a279fc6ad5bb76e4d2c2eb3432955b5e11c.tar.bz2
Do not allow "x + 0.0" to "x" optimization with -fsignaling-nans
gcc/ PR rtl-optimization/110305 * simplify-rtx.cc (simplify_context::simplify_binary_operation_1): Handle HONOR_SNANS for x + 0.0.
-rw-r--r--gcc/simplify-rtx.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index 9c68d36..1b58144 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -2831,7 +2831,8 @@ simplify_context::simplify_binary_operation_1 (rtx_code code,
when x is NaN, infinite, or finite and nonzero. They aren't
when x is -0 and the rounding mode is not towards -infinity,
since (-0) + 0 is then 0. */
- if (!HONOR_SIGNED_ZEROS (mode) && trueop1 == CONST0_RTX (mode))
+ if (!HONOR_SIGNED_ZEROS (mode) && !HONOR_SNANS (mode)
+ && trueop1 == CONST0_RTX (mode))
return op0;
/* ((-a) + b) -> (b - a) and similarly for (a + (-b)). These