On 8/24/26 11:46, Eric Botcazou wrote:
Yeah,    query->range_of_expr (vr_lb, low_bound) would be the generally
accepted way to generate a range from an arbitrary tree...  including a
constant.
Thanks.  Does the sequence

                    && !vr.varying_p ()
                    && !vr.undefined_p ()

need to be repeated after the call to fold_range succeeded, given that earlier
calls passed for vr_expr and the low bound is a constant?


Theoretically no.  operator minus on a constant shouldn't produce either of those results from a value that isn't already either one.    Unless some edge case like [-INF, -INF] - 1 for signed values showed up.    That could get you UNDEFINED perhaps.

My slight preference would be to just do the math and simply check at the end..      Fold will work fine on all those values  (in fact UNDEFINED gets translated to VARYING I believe).  so I don't see the point in multiple checks. .. yeah, slightly more work I suppose.. But it eliminates any possibility that operator_minus does something unexpected.

Andrew

Reply via email to