]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Convert flag_finite_math_only uses in frange to HONOR_*.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 25 Oct 2022 20:22:56 +0000 (22:22 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 26 Oct 2022 06:07:34 +0000 (08:07 +0200)
As mentioned earlier, we should be using HONOR_* on types rather than
flag_finite_math_only.

gcc/ChangeLog:

* value-range.cc (frange::set): Use HONOR_*.
(frange::verify_range): Same.
* value-range.h (frange_val_min): Same.
(frange_val_max): Same.

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

index d8ee6ec0d0f83dff39d880e196efafc5cad22db8..77e5a2cc29948e496cecd525928c8287c5ccb9ba 100644 (file)
@@ -341,7 +341,7 @@ frange::set (tree type,
 
   // For -ffinite-math-only we can drop ranges outside the
   // representable numbers to min/max for the type.
-  if (flag_finite_math_only)
+  if (!HONOR_INFINITIES (m_type))
     {
       REAL_VALUE_TYPE min_repr = frange_val_min (m_type);
       REAL_VALUE_TYPE max_repr = frange_val_max (m_type);
@@ -712,8 +712,8 @@ frange::supports_type_p (const_tree type) const
 void
 frange::verify_range ()
 {
-  if (flag_finite_math_only)
-    gcc_checking_assert (!maybe_isnan ());
+  if (!undefined_p ())
+    gcc_checking_assert (HONOR_NANS (m_type) || !maybe_isnan ());
   switch (m_kind)
     {
     case VR_UNDEFINED:
index b48542a68aa14f1306550c7f64bd2ef9cddbd277..c87734dd8cdb6dcfe64358282eeda1fbf59c1d30 100644 (file)
@@ -1201,10 +1201,10 @@ real_min_representable (const_tree type)
 inline REAL_VALUE_TYPE
 frange_val_min (const_tree type)
 {
-  if (flag_finite_math_only)
-    return real_min_representable (type);
-  else
+  if (HONOR_INFINITIES (type))
     return dconstninf;
+  else
+    return real_min_representable (type);
 }
 
 // Return the maximum value for TYPE.
@@ -1212,10 +1212,10 @@ frange_val_min (const_tree type)
 inline REAL_VALUE_TYPE
 frange_val_max (const_tree type)
 {
-  if (flag_finite_math_only)
-    return real_max_representable (type);
-  else
+  if (HONOR_INFINITIES (type))
     return dconstinf;
+  else
+    return real_max_representable (type);
 }
 
 // Return TRUE if R is the minimum value for TYPE.