https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117140
--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 16 Oct 2024, tnfchris at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117140 > > --- Comment #7 from Tamar Christina <tnfchris at gcc dot gnu.org> --- > For this statement somehow the location of the gsi ends up having > first == last, so gsi_insert_before just silently ignores the insert. > > The ICE happens because for this one BB, no vector statement is ever emitted > to > the BB. > > Reverting to the original code I had > > diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc > index 8727246c27a..c028594e18b 100644 > --- a/gcc/tree-vect-slp.cc > +++ b/gcc/tree-vect-slp.cc > @@ -11128,7 +11128,8 @@ vectorize_slp_instance_root_stmt (vec_info *vinfo, > slp_tree node, slp_instance i > can't support lane > 1 at this time. */ > gcc_assert (instance->root_stmts.length () == 1); > auto root_stmt_info = instance->root_stmts[0]; > - auto last_stmt = STMT_VINFO_STMT (root_stmt_info); if this is a pattern you'd want STMT_VINFO_STMT (vect_orig_stmt (root_stmt_info))