https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119057

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rgue...@gcc.gnu.org>:

https://gcc.gnu.org/g:ad756e186f6352b1369c8094ec8973736142933e

commit r12-11227-gad756e186f6352b1369c8094ec8973736142933e
Author: Richard Biener <rguent...@suse.de>
Date:   Mon Mar 3 13:21:53 2025 +0100

    tree-optimization/119057 - bogus double reduction detection

    We are detecting a cycle as double reduction where the inner loop
    cycle has extra out-of-loop uses.  This clashes at least with
    assumptions from the SLP discovery code which says the cycle
    isn't reachable from another SLP instance.  It also was not intended
    to support this case, in fact with GCC 14 we seem to generate wrong
    code here.

            PR tree-optimization/119057
            * tree-vect-loop.cc (check_reduction_path): Add argument
            specifying whether we're analyzing the inner loop of a
            double reduction.  Do not allow extra uses outside of the
            double reduction cycle in this case.
            (vect_is_simple_reduction): Adjust.

            * gcc.dg/vect/pr119057.c: New testcase.

    (cherry picked from commit 758de6263dfc7ba8701965fa468691ac23cb7eb5)
  • [Bug tree-optimization/119057] ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to