[Bug target/126550] RISC-V: auto-vectorization miscompiles duplicated deinterleave store via vcompress/vrgather (rv64gcv_zvl256b)

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126550

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

https://gcc.gnu.org/g:4e3274800752936bb5cdcafe836b7cd700f8ad6d

commit r16-9524-g4e3274800752936bb5cdcafe836b7cd700f8ad6d
Author: Robin Dapp <[email protected]>
Date:   Tue Aug 4 11:37:33 2026 +0200

    RISC-V: Fix single-step expansion [PR126550].

    In expand_const_vector_single_step_npatterns, we use a second vector
    builder that is derived from the main one, in order to create a
    different alternating pattern for constant synthesis.  We later use the
    second builder's number of patterns for creating an intermediate
    operation.  The second builder can have a different number of patterns
    than the first one, however, for example when its "global" pattern is
    simpler.

    This patch uses npatterns from the original builder.

            PR target/126550

    gcc/ChangeLog:

            * config/riscv/riscv-v.cc
(expand_const_vector_single_step_npatterns):
            User global builder's npatterns.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/autovec/pr126550-2.c: New test.
            * gcc.target/riscv/rvv/autovec/pr126550.c: New test.

    (cherry picked from commit 7cdbbbdecb09e518e28c5116b05e0018b9460b95)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.