https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114249
--- Comment #7 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:3a910114fdb2aa76495c4c748acf6b9c7fbecc89 commit r14-9331-g3a910114fdb2aa76495c4c748acf6b9c7fbecc89 Author: Richard Biener <rguent...@suse.de> Date: Wed Mar 6 09:25:15 2024 +0100 tree-optimization/114249 - ICE with BB reduction vectorization When we scrap the last def of an odd lane numbered BB reduction we can end up recording a pattern def which will later wreck code generation. The following puts this logic where it better belongs, avoiding this issue. PR tree-optimization/114249 * tree-vect-slp.cc (vect_build_slp_instance): Move making a BB reduction lane number even ... (vect_slp_check_for_roots): ... here to avoid leaking pattern defs. * gcc.dg/vect/bb-slp-pr114249.c: New testcase.