On Fri, Mar 10, 2023 at 08:53:37AM +0000, Richard Biener wrote: > Meh - I wonder if we can avoid all this by making float_widen_lhs_range > friend of frange and simply access m_min/m_max directly and use the > copy-CTOR to copy bounds and nan state ... after all verify_range > will likely fail after you restore flag_finite_math_only ...
I'll defer such changes to Aldy. As for verification, I think verify_range will not fail on it, it mainly checks whether it is normalized (e.g. if minimum is frange_val_min and maximum is frange_val_max and NaNs are possible with both signs (if NaNs are supported) then it is VR_VARYING etc.). It doesn't check if the actual VR_RANGE bounds are smaller or larger than the VR_VARYING bounds, there is just equality check. Of course, behavior of wider than varying ranges is still unexpected in many ways, say the union_ of such a range and VR_VARYING will ICE etc. Now, I guess another possibility for the reverse ops over these wider ranges would be avoid calling fold_range in the reverse ops, but call rv_fold directly or have fold_range variant which would instead of the op1, op2 argument have 2 triplets, op1, op1lb, op1ub, op2, op2lb, op2ub, and it would use those const REAL_VALUE_TYPE &op??b in preference to op?.{lower,upper}_bound () or perhaps normal fold_range be implemented in terms of this extended fold_range. Then we wouldn't need to bother with these non-standard franges... > But OK for the moment. Thanks, committed. Jakub