https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105219
--- Comment #15 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- (In reply to Richard Biener from comment #14) > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > index d7bc34636bd..3b63ab7b669 100644 > --- a/gcc/tree-vect-loop.cc > +++ b/gcc/tree-vect-loop.cc > @@ -9977,7 +9981,7 @@ vect_transform_loop (loop_vec_info loop_vinfo, gimple > *loop_vectorized_call) > lowest_vf) - 1 > : wi::udiv_floor (loop->nb_iterations_upper_bound + > bias_for_lowest, > lowest_vf) - 1); > - if (main_vinfo) > + if (main_vinfo && !main_vinfo->peeling_for_alignment) > { > unsigned int bound; > poly_uint64 main_iters It might be better to add the maximum peeling amount to main_iters. Maybe you'd prefer this anyway for GCC 12 though. I wonder if there's a similar problem for peeling for gaps, in cases where the epilogue doesn't need the same peeling.