https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105053
--- Comment #6 from CVS 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:fe705dce2e1e3e4e5e0c69d7f9adaf7f2777cdc8 commit r12-7816-gfe705dce2e1e3e4e5e0c69d7f9adaf7f2777cdc8 Author: Richard Biener <rguent...@suse.de> Date: Fri Mar 25 14:31:25 2022 +0100 tree-optimization/105053 - fix reduction chain epilogue generation When we optimize permutations in a reduction chain we have to be careful to select the correct live-out stmt, otherwise the reduction result will be unused and the retained scalar code will execute only the number of vector iterations. 2022-03-25 Richard Biener <rguent...@suse.de> PR tree-optimization/105053 * tree-vect-loop.cc (vect_create_epilog_for_reduction): Pick the correct live-out stmt for a reduction chain. * g++.dg/vect/pr105053.cc: New testcase.