https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120687
--- Comment #8 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:e8a51144c02e1cf210db5763e435802ac6fa6ad9 commit r16-2601-ge8a51144c02e1cf210db5763e435802ac6fa6ad9 Author: Richard Biener <rguent...@suse.de> Date: Tue Jul 29 10:05:32 2025 +0200 tree-optimization/120687 - avoid disturbing reduction chains in reassoc Reassoc carefully ranks operands to form reduction chains for vectorization so we are careful to not apply any width related changes in the early pass. Unfortunately we are not careful enough. The following gates fma related re-ordering and also the >= 3 ops tail "optimization" which is the culprit here. This does not fix the reported inefficient vectorization when using signed integer reductions yet. PR tree-optimization/120687 * tree-ssa-reassoc.cc (reassociate_bb): Do not disturb the sorted operand order in the early pass. * tree-vect-slp.cc (vect_analyze_slp): Dump when a detected reduction chain fails SLP discovery. * gcc.dg/vect/pr120687-1.c: New testcase. * gcc.dg/vect/pr120687-2.c: Likewise.