public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] Do not test for -Inf when flag_finite_math_only.
@ 2022-10-17 13:28 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2022-10-17 13:28 UTC (permalink / raw)
  To: GCC patches; +Cc: Andrew MacLeod, Aldy Hernandez

	PR tree-optimizatin/107286

gcc/ChangeLog:

	* value-range.cc (range_tests_floats): Do not test for -Inf when
	flag_finite_math_only.
---
 gcc/value-range.cc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 4794d2386a8..90d5e660684 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -4022,10 +4022,13 @@ range_tests_floats ()
   r0.intersect (r1);
   ASSERT_TRUE (r0.undefined_p ());
 
-  // Make sure [-Inf, -Inf] doesn't get normalized.
-  r0 = frange_float ("-Inf", "-Inf");
-  ASSERT_TRUE (real_isinf (&r0.lower_bound (), true));
-  ASSERT_TRUE (real_isinf (&r0.upper_bound (), true));
+  if (!flag_finite_math_only)
+    {
+      // Make sure [-Inf, -Inf] doesn't get normalized.
+      r0 = frange_float ("-Inf", "-Inf");
+      ASSERT_TRUE (real_isinf (&r0.lower_bound (), true));
+      ASSERT_TRUE (real_isinf (&r0.upper_bound (), true));
+    }
 }
 
 void
-- 
2.37.3


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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 13:28 [COMMITTED] Do not test for -Inf when flag_finite_math_only 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).