https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107569

--- Comment #12 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
It looks like the code reading from the blob in SSA_NAME_RANGE_INFO and
populating an frange is always leaving the NAN bit toggled even if it wasn't in
the stored range.

Does this help?

diff --git a/gcc/value-range-storage.cc b/gcc/value-range-storage.cc
index 462447ba250..7ba7a16edc2 100644
--- a/gcc/value-range-storage.cc
+++ b/gcc/value-range-storage.cc
@@ -283,6 +283,8 @@ frange_storage_slot::get_frange (frange &r, tree type)
const
   // make sure to set the NAN sign if known.
   if (HONOR_NANS (type) && (m_pos_nan ^ m_neg_nan) == 1)
     r.update_nan (m_neg_nan);
+  else if (!m_pos_nan && !m_neg_nan)
+    r.clear_nan ();
 }

 bool

Reply via email to