https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128140
--- Comment #3 from Richard Sandiford <rsandifo at gcc dot gnu.org> --- (In reply to Richard Biener from comment #1) > Confirmed. The issue is that uniform_vector_difference_p fails to catch > wrap-around when looking at only the encoded elements. This makes the > match.pd transform to MAX trigger bogusly. > > With us now having a bound on VLEN we might be able to compute whether there > will be a wraparound even for variable-length vectors. Otherwise falling > back to the else path (checking all elements) is probably easiest. > Richard? Do you mean specifically for VECTOR_CST_STEPPED_P? (Only needs to be checked on one operand, given the rest of the condition.) If so, then yeah, that sounds good to me. As you say, with the new bound, we could probably just make the else branch process the maximum vector length. The patch in comment 2 doesn't look correct to me.
