On Wed, Jan 25, 2023 at 11:12:11AM -0500, Andrew MacLeod via Gcc-patches wrote: > In GCC13, I don't think there are any uses of the relation oracle outside of > ranger and range-ops. > > So, given that, perhaps the simplest thing to do is bail on all this change, > and instead simply do the following which also fixes the PR. (im running it > thru tests as we speak) > > > > diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc > index 91eb6298254..9c5359a3fc6 100644 > --- a/gcc/gimple-range-fold.cc > +++ b/gcc/gimple-range-fold.cc > @@ -1039,6 +1039,9 @@ fold_using_range::relation_fold_and_or (irange& > lhs_range, gimple *s, > if (!ssa1_dep1 || !ssa1_dep2 || !ssa2_dep1 || !ssa2_dep2) > return; > > + if (HONOR_NANS (TREE_TYPE (ssa1_dep1))) > + return; > + > // Make sure they are the same dependencies, and detect the order of the > // relationship. > bool reverse_op2 = true; > >
If this works, maybe (does something check if ssa1_dep1 has certain type (I assume ssa1_dep2 has to have the same) then ssa2_dep{1,2} has that type too (or uselessly equal to that)? Though, if this spot has both operands of the comparison, could we for HONOR_NANS case ask frange if any of them is maybe_nan or known_nan and punt only if anything can be NAN? Jakub