]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not test for -Inf when flag_finite_math_only.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 17 Oct 2022 13:26:05 +0000 (15:26 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 17 Oct 2022 13:29:21 +0000 (15:29 +0200)
PR tree-optimization/107286

gcc/ChangeLog:

* value-range.cc (range_tests_floats): Do not test for -Inf when
flag_finite_math_only.

gcc/value-range.cc

index 4794d2386a80e5f68737bcfc148e461b3927f74f..90d5e6606843acca28a5f0c9759c7375e8a268b7 100644 (file)
@@ -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