public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3308] Implement distinction between HONOR_SIGNED_ZEROS and MODE_HAS_SIGNED_ZEROS.
@ 2022-10-14 17:40 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2022-10-14 17:40 UTC (permalink / raw)
  To: gcc-cvs

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

commit r13-3308-gb4a4c6382b14bc107d6d95ff809f3e9cd71944e7
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Fri Oct 14 16:49:33 2022 +0200

    Implement distinction between HONOR_SIGNED_ZEROS and MODE_HAS_SIGNED_ZEROS.
    
    gcc/ChangeLog:
    
            * value-range.cc (frange::set): Implement distinction between
            HONOR_SIGNED_ZEROS and MODE_HAS_SIGNED_ZEROS.

Diff:
---
 gcc/value-range.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index ee15eb35df8..4794d2386a8 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -324,13 +324,20 @@ frange::set (tree type,
       m_neg_nan = false;
     }
 
-  if (!HONOR_SIGNED_ZEROS (m_type))
+  if (!MODE_HAS_SIGNED_ZEROS (TYPE_MODE (m_type)))
     {
       if (real_iszero (&m_min, 1))
 	m_min.sign = 0;
       if (real_iszero (&m_max, 1))
 	m_max.sign = 0;
     }
+  else if (!HONOR_SIGNED_ZEROS (m_type))
+    {
+      if (real_iszero (&m_max, 1))
+	m_max.sign = 0;
+      if (real_iszero (&m_min, 0))
+	m_min.sign = 1;
+    }
 
   // For -ffinite-math-only we can drop ranges outside the
   // representable numbers to min/max for the type.

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

only message in thread, other threads:[~2022-10-14 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 17:40 [gcc r13-3308] Implement distinction between HONOR_SIGNED_ZEROS and MODE_HAS_SIGNED_ZEROS Aldy Hernandez

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).