https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121830
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:f7426ba6c0d4f779ff0f2f84e8beeadc88ebe47c commit r16-3663-gf7426ba6c0d4f779ff0f2f84e8beeadc88ebe47c Author: Richard Biener <[email protected]> Date: Mon Sep 8 13:25:37 2025 +0200 tree-optimization/121830 - SLP cycle detection confused by nested cycle The SLP reduc-index computation is confused by having an outer reduction inner loop nested cycle fed by another non-reduction nested cycle. Instead of undoing the unfortunate mixing of outer reduction inner cycles with general nested cycles the following instead distinguishes them by not setting STMT_VINFO_REDUC_DEF on the non-reduction nested cycles. PR tree-optimization/121830 * tree-vect-loop.cc (vect_analyze_scalar_cycles_1): Only set STMT_VINFO_REDUC_DEF on reductions. * tree-vect-slp.cc (vect_build_slp_tree_2): Identify reduction PHIs by a set STMT_VINFO_REDUC_DEF instead of their def type. * gcc.dg/vect/pr121830.c: New testcase.
