On 8/4/2026 5:03 AM, Robin Dapp wrote:
Hi,

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.

Regtested on rv64gcv_zvl512b.

It's surprising that this went unnoticed for so long.  Definitely
requires backporting to 16, 15, and maybe 14.

Regards
  Robin


        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.
LGTM.
jeff

Reply via email to