https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105053
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:825151e16373760527678df8ad524bd725e36c7b commit r11-9784-g825151e16373760527678df8ad524bd725e36c7b 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.c (vect_create_epilog_for_reduction): Pick the correct live-out stmt for a reduction chain. * g++.dg/vect/pr105053.cc: New testcase.