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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Richard Biener
<[email protected]>:

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

commit r16-9906-gf6586e410cf92aa17b535c42b3b54e6030395e70
Author: Richard Biener <[email protected]>
Date:   Tue Nov 3 13:29:18 2026 +0100

    tree-optimization/127924 - use correct loop mask for multi-part simd clone
masks

    When an inbranch simd clone call in a fully-masked loop needs multiple
    mask arguments per call (for example simdlen(32) with 16-lane AVX512
    masks), vectorizable_simd_clone_call iterates M over the mask parts but
    fetched the loop mask with the call copy index J.  All parts of a call
    were thus ANDed with the first loop mask, enabling lanes beyond the
    iteration count for the later parts and calling the clone on inactive
    lanes.  Use M as the loop mask index instead.

            PR tree-optimization/127924
            * tree-vect-stmts.cc (vectorizable_simd_clone_call): Use the
            mask part index M rather than the copy index J when getting the
            loop mask for explicit mask arguments.

            * gcc.target/i386/vect-simd-clone-avx512-4.c: New test.

    (cherry picked from commit 1b3a0deba8302912cfbc5faf850a6abcdb3e984a)

Reply via email to