public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1952] Do not allow "x + 0.0" to "x" optimization with -fsignaling-nans
@ 2023-06-19 17:53 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-06-19 17:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:827b2a279fc6ad5bb76e4d2c2eb3432955b5e11c

commit r14-1952-g827b2a279fc6ad5bb76e4d2c2eb3432955b5e11c
Author: Toru Kisuki <tkisuki@tachyum.com>
Date:   Mon Jun 19 11:51:09 2023 -0600

    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.

Diff:
---
 gcc/simplify-rtx.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index 9c68d360672..1b581447de6 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-19 17:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 17:53 [gcc r14-1952] Do not allow "x + 0.0" to "x" optimization with -fsignaling-nans Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).