https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113467
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #7) > Does the following fix the issue? > > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > index 330c4571c8d..b67ee783002 100644 > --- a/gcc/tree-vect-loop.cc > +++ b/gcc/tree-vect-loop.cc > @@ -998,6 +1000,9 @@ vec_init_loop_exit_info (class loop *loop) > } > } > > + if (candidate->src != single_pred (loop->latch)) > + return NULL; > + > return candidate; > } diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 330c4571c8d..5261c1d4fa0 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -998,6 +1000,9 @@ vec_init_loop_exit_info (class loop *loop) } } + if (candidate && candidate->src != single_pred (loop->latch)) + return NULL; + return candidate; } of course