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

--- Comment #4 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:e2f1aec551be259b6ac562dae4f04eff77a06f23

commit r17-5994-ge2f1aec551be259b6ac562dae4f04eff77a06f23
Author: Richard Biener <[email protected]>
Date:   Wed Nov 4 10:43:08 2026 +0100

    tree-optimization/128433 - disable partial vectors for loads not covering
whole vectors

    For permuted SLP loads the group accessed in one vector iteration
    might not fill a whole number of vectors, for example for a load
    of s[i] with load permutation { 0, 0 } and V16SF vectors at VF 8
    which loads 16 elements but only uses 8. 
check_load_store_for_partial_vectors
    rounded the number of vectors up and recorded a loop mask for
    one V16SF vector.  But the rgroup controls are computed for
    NVECTORS * NUNITS / VF scalars per iteration, so the load ended up
    using the mask for two scalars per iteration, enabling twice the
    number of elements the scalar loop accesses and faulting when that
    crosses into an unmapped page.  The same applies to loop lengths.

    Since neither masks nor lengths can represent such an access,
    do not use partial vectors for it.

            PR tree-optimization/128433
            * tree-vect-stmts.cc (check_load_store_for_partial_vectors):
            Disable partial vectors when the group accessed per vector
            iteration does not cover a whole number of vectors.

            * gcc.target/i386/vect-partial-perm-load-1.c: New testcase.
            * gcc.dg/vect/pr128433.c: Likewise.

Reply via email to