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

--- Comment #8 from CVS 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:d127348d7711e148e5ddd205a8c3409b37fae64c

commit r12-8840-gd127348d7711e148e5ddd205a8c3409b37fae64c
Author: Richard Biener <rguent...@suse.de>
Date:   Tue Oct 11 11:34:55 2022 +0200

    tree-optimization/107212 - SLP reduction of reduction paths

    The following fixes an issue with how we handle epilogue generation
    for SLP reductions of reduction paths where the actual live lanes
    are not "canonical".  We need to make sure to identify all live
    lanes as reductions and thus have to iterate over all participating
    SLP lanes when walking the reduction SSA use-def chain.  Also the
    previous attempt likely to mitigate such issue in
    vectorizable_live_operation is misguided and has to be removed.

            PR tree-optimization/107212
            * tree-vect-loop.cc (vectorizable_reduction): Make sure to
            set STMT_VINFO_REDUC_DEF for all live lanes in a SLP
            reduction.
            (vectorizable_live_operation): Do not pun to the SLP
            node representative for reduction epilogue generation.

            * gcc.dg/vect/pr107212-1.c: New testcase.
            * gcc.dg/vect/pr107212-2.c: Likewise.

    (cherry picked from commit ee467644c53ee2f7d633a8e1f53603feafab4351)

Reply via email to