Hello,

Le 20/10/2022 à 16:13, Aldy Hernandez via Gcc-patches a écrit :
The finite_operands_p function was incorrectly named, as it only
returned TRUE when !NAN.  This was leftover from the initial
implementation of frange.  Using the maybe_isnan() nomenclature is
more consistent and easier to understand.

(...)

diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 0605a908684..2a4a99ba467 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
(...)
@@ -441,7 +436,7 @@ foperator_equal::op1_range (frange &r, tree type,
        // If the result is false, the only time we know anything is
        // if OP2 is a constant.
        else if (op2.singleton_p ()
-              || (finite_operand_p (op2) && op2.zero_p ()))
+              || (!op2.maybe_isnan () && op2.zero_p ()))
        {
          REAL_VALUE_TYPE tmp = op2.lower_bound ();
          r.set (type, tmp, tmp, VR_ANTI_RANGE);

Doesn't this miss a check of flag_finite_math_only to be strictly equivalent? You keep that check for the two-arguments case, so I guess it's not redundant?

Reply via email to