https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115652
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:f80db5495d5f8455b3003951727eb6c8dc67d81d commit r15-1653-gf80db5495d5f8455b3003951727eb6c8dc67d81d Author: Richard Biener <rguent...@suse.de> Date: Wed Jun 26 09:25:27 2024 +0200 tree-optimization/115652 - adjust insertion gsi for SLP The following adjusts how SLP computes the insertion location. In particular it advanced the insert iterator of the found last_stmt. The vectorizer will later insert stmts _before_ it. But we also have the constraint that possibly masked ops may not be scheduled outside of the loop and as we do not model the loop mask in the SLP graph we have to adjust for that. The following moves this to after the advance since it isn't compatible with that as the current GIMPLE_COND exception shows. The PR is about in-order reduction vectorization which also isn't happy when that's the very first stmt. PR tree-optimization/115652 * tree-vect-slp.cc (vect_schedule_slp_node): Advance the iterator based on last_stmt only for vector defs.