https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107591
--- Comment #9 from Andrew Macleod <amacleod at redhat dot com> --- (In reply to Jakub Jelinek from comment #8) > (In reply to Aldy Hernandez from comment #6) > > FYI, the range operators have a relation field, so it should be able to tell > > you that both operands are equal with VREL_EQ (?). You could use that to > > optimize things. > > You're right, at least for irange trio.op1_op2 () in the mult fold_range is > VREL_EQ and we could just go from that. > For frange perhaps it isn't as perfect because of signed zeros, so in > float > foo (float x, float y) > { > if (x == y) > return x * y; > return 42.0f; > } > trio.op1_op2 () could be VREL_EQ even if one is signed and the other > unsigned zero, and in that case -0.0 would need to be in the range too. But > maybe that is good enough for now. you could also test whether op1_range contains + and/or - 0, as well as op2_range. VREL_EQ is a symbolic equality.. the ranges can still be distinct and individually testable to see if you have a +0 and -0.. I guess you could also test for equality of the ranges.. op1_range == op2_range