]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Implement distinction between HONOR_SIGNED_ZEROS and MODE_HAS_SIGNED_ZEROS.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 14 Oct 2022 14:49:33 +0000 (16:49 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 14 Oct 2022 16:43:50 +0000 (18:43 +0200)
gcc/ChangeLog:

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

gcc/value-range.cc

index ee15eb35df88eb528fd724001724e3d5bedb784f..4794d2386a80e5f68737bcfc148e461b3927f74f 100644 (file)
@@ -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.