https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115383
--- 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:c1429e3a8da0cdfe9391e1e9b2c7228d896a3a87 commit r15-1126-gc1429e3a8da0cdfe9391e1e9b2c7228d896a3a87 Author: Richard Biener <rguent...@suse.de> Date: Fri Jun 7 12:15:31 2024 +0200 tree-optimization/115383 - EXTRACT_LAST_REDUCTION with multiple stmt copies The EXTRACT_LAST_REDUCTION code isn't ready to deal with multiple stmt copies but SLP no longer checks for this. The following adjusts code generation to handle the situation. PR tree-optimization/115383 * tree-vect-stmts.cc (vectorizable_condition): Handle generating a chain of .FOLD_EXTRACT_LAST. * gcc.dg/vect/pr115383.c: New testcase.