https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122308
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:d6986e06db5eeb797344d86bd3ef9b0654606bbd commit r16-4469-gd6986e06db5eeb797344d86bd3ef9b0654606bbd Author: Richard Biener <[email protected]> Date: Fri Oct 17 15:12:11 2025 +0200 tree-optimization/122308 - apply LIM after unroll-and-jam Just like with loop interchange, unroll-and-jam can leave invariant stmts in the inner loop from outer loop stmts inbetween the two inner loop copies. Do a per-function invariant motion when we applied unroll-and-jam. This avoids failed dataref analysis and fallback to gather/scatter during vectorization. PR tree-optimization/122308 * gimple-loop-jam.cc (tree_loop_unroll_and_jam): Do LIM after applying unroll-and-jam. * gcc.dg/vect/vect-pr122308.c: New testcase.
