https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111764
--- Comment #11 from GCC 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:7473b2742aa1637d14a64505e855aa09452536b1 commit r11-11143-g7473b2742aa1637d14a64505e855aa09452536b1 Author: Richard Biener <rguent...@suse.de> Date: Thu Oct 12 09:09:46 2023 +0200 tree-optimization/111764 - wrong reduction vectorization The following removes a misguided attempt to allow x + x in a reduction path, also allowing x * x which isn't valid. x + x actually never arrives this way but instead is canonicalized to 2 * x. This makes reduction path handling consistent with how we handle the single-stmt reduction case. PR tree-optimization/111764 * tree-vect-loop.c (check_reduction_path): Remove the attempt to allow x + x via special-casing of assigns. * gcc.dg/vect/pr111764.c: New testcase. (cherry picked from commit 05f98310b54da95e468d799f4a910174320cccbb)