https://gcc.gnu.org/g:c5e57d89b587e5efdfca0d9f3044b6e23bb41ce8

commit r17-3162-gc5e57d89b587e5efdfca0d9f3044b6e23bb41ce8
Author: Aldy Hernandez <[email protected]>
Date:   Sun Aug 9 07:33:40 2026 +0000

    [frange] Convert float_binary_op_range_finish to sub-ranges
    
    Use contains_zero_p to handle sub-ranges.
    
    Tested on ppc64le Linux.
    
    gcc/ChangeLog:
    
            * range-op-float.cc (float_binary_op_range_finish): Use
            contains_zero_p on lhs instead of inspecting the hull endpoints.

Diff:
---
 gcc/range-op-float.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 156b4f766db9..60c522ee2a0e 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -2256,8 +2256,7 @@ float_binary_op_range_finish (bool ret, frange &r, tree 
type,
     {
       r.clear_nan ();
       if (div_op2
-         ? !(real_compare (LE_EXPR, &lhs.lower_bound (), &dconst0)
-             && real_compare (GE_EXPR, &lhs.upper_bound (), &dconst0))
+         ? !lhs.contains_zero_p ()
          : !(real_isinf (&lhs.lower_bound ())
              || real_isinf (&lhs.upper_bound ())))
        // For reverse + or - or * or op1 of /, if result is finite, then

Reply via email to