diff mbox series

[COMMITTED] Do not test for -Inf when flag_finite_math_only.

Message ID 20221017132838.24693-1-aldyh@redhat.com
State New
Headers show
Series [COMMITTED] Do not test for -Inf when flag_finite_math_only. | expand

Commit Message

Aldy Hernandez Oct. 17, 2022, 1:28 p.m. UTC
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 mbox series

Patch

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