https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102861
--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 21 Oct 2021, aldyh at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102861 > > --- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- > (In reply to Richard Biener from comment #3) > > Yeah, I think these kind of testsuite changes are no good. > > The loop threading restrictions disallow a couple jump threads (rotating the > loop and crossing the loop header without exiting the loop). The test was > depending on these invalid threads to trigger the "optimized: basic block" > diagnostic. Jeff suggested manually rotating the loop to continue testing the > SLP functionality. > > Is there something else we could do? Look what exactly is missing and restore that - testcases are written from real-world code that we expect to optimize, adjusting them to hide the fact that we don't any longer is not good. Even XFAIL would have been better. That said, loop header copying is supposed to do the rotation. Note what I see on the unchanged testcase is that we now loop vectorize which is great (and obviously no BB vectorization opportunity remains). So a different fix would be to simply add /* Avoid loop vectorization. */ /* { dg-additional-options "-fno-tree-loop-vectorize" } */ which makes the testcase PASS again (bonus for adding a variant of the testcase that verifies we loop vectorize this). Let me do all this for you.