]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Stream out endpoints for frange.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 31 Aug 2022 10:09:44 +0000 (12:09 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 31 Aug 2022 12:38:59 +0000 (14:38 +0200)
We only stream out the FP properties for global float ranges
(currently only NAN).  The following patch adds the endpoints as well.

gcc/ChangeLog:

* value-range-storage.cc (frange_storage_slot::set_frange): Save
endpoints.
(frange_storage_slot::get_frange): Restore endpoints.
* value-range-storage.h (class frange_storage_slot): Add endpoint
fields.

gcc/value-range-storage.cc
gcc/value-range-storage.h

index 494392737ac166bf49027a48cbd0663e486660c3..b7a23fa9825c73d09bd49ce7dca6e603199f21e8 100644 (file)
@@ -253,6 +253,8 @@ frange_storage_slot::set_frange (const frange &r)
   gcc_checking_assert (fits_p (r));
   gcc_checking_assert (!r.undefined_p ());
 
+  m_min = r.m_min;
+  m_max = r.m_max;
   m_props = r.m_props;
 }
 
@@ -261,18 +263,12 @@ frange_storage_slot::get_frange (frange &r, tree type) const
 {
   gcc_checking_assert (r.supports_type_p (type));
 
-  // FIXME: NANs get special treatment, because we need [NAN, NAN] in
-  // the range to properly represent it, not just the NAN flag in the
-  // property bits.  This will go away when we stream out the
-  // endpoints.
-  if (m_props.get_nan ().yes_p ())
-    {
-      r = frange_nan (type);
-      return;
-    }
-
-  r.set_varying (type);
+  r.set_undefined ();
+  r.m_kind = VR_RANGE;
   r.m_props = m_props;
+  r.m_type = type;
+  r.m_min = m_min;
+  r.m_max = m_max;
   r.normalize_kind ();
 
   if (flag_checking)
index 9cd6b9f7bec70b128fd1a37d513a5ccbb2c1f6f7..f506789f3d145bc73ea9f1438c35da4dd2e8dd62 100644 (file)
@@ -113,9 +113,11 @@ class GTY (()) frange_storage_slot
   frange_storage_slot (const frange &r) { set_frange (r); }
   DISABLE_COPY_AND_ASSIGN (frange_storage_slot);
 
-  // We can get away with just storing the properties because the type
-  // can be gotten from the SSA, and UNDEFINED is unsupported, so it
-  // can only be a range.
+  // We can get away with just storing the properties and the
+  // endpoints because the type can be gotten from the SSA, and
+  // UNDEFINED is unsupported, so it can only be a VR_RANGE.
+  REAL_VALUE_TYPE m_min;
+  REAL_VALUE_TYPE m_max;
   frange_props m_props;
 };