https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121202
--- Comment #5 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:bdfb5cc5aa6959a6959fc0cf98da08db89c81032 commit r16-2422-gbdfb5cc5aa6959a6959fc0cf98da08db89c81032 Author: Richard Biener <rguent...@suse.de> Date: Tue Jul 22 13:02:03 2025 +0200 tree-optimization/121202 - fix vector stmt placement When we have a vector shift with a scalar the shift operand can be external - in that case we should not use the shift operand def as hint where to place the vector shift instruction. The ICE in the PR is because stmt dominance queries only work inside of the vector region. But we should also never place stmts outside of it. PR tree-optimization/121202 * tree-vect-slp.cc (vect_schedule_slp_node): Do not take an out-of-region stmt as "last". * gcc.dg/pr121202.c: New testcase.