https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113163
--- Comment #12 from Tamar Christina <tnfchris at gcc dot gnu.org> --- (In reply to Andrew Stubbs from comment #11) > (In reply to Tamar Christina from comment #7) > > This seems to happen because the vectorizer decides to use partial vectors > > to vectorize the loop and the target picks a nonlinear induction step which > > we can't support for early breaks. > > In which hook is this selected? > > I'm not aware of this being a deliberate choice we made... I haven't looked into why on the target we get a nonlinear induction (mostly because I don't know much about the target). I however wasn't able to reproduce it on SVE and x86_64 even when forcing partial vectors. So I guess it's more accurate to say "something about the target" is making the vectorizer pick a nonlinear induction. most likely missing support for something. Note that the testcase does work if partial vectors is turned off. So It should work fine if the vectorizer retries without partial vectors. waiting for Richi to come back from holiday to review the patch and should be fixed.