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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <l...@gcc.gnu.org>:

https://gcc.gnu.org/g:28b2ad5341f875ee7e034b0c6f9e4eb725e19a8f

commit r15-7516-g28b2ad5341f875ee7e034b0c6f9e4eb725e19a8f
Author: Robin Dapp <rdapp....@gmail.com>
Date:   Thu Feb 13 16:33:24 2025 -0700

    RISC-V: Avoid more unsplit insns in const expander [PR118832].

    Hi,

    in PR118832 we have another instance of the problem already noticed in
    PR117878.  We sometimes use e.g. expand_simple_binop for vector
    operations like shift or and.  While this is usually OK, it causes
    problems when doing it late, e.g. during LRA.

    In particular, we might rematerialize a const_vector during LRA, which
    then leaves an insn laying around that cannot be split any more if it
    requires a pseudo.  Therefore we should only use the split variants
    in expand_const_vector.

    This patch fixed the issue in the PR and also pre-emptively rewrites two
    other spots that might be prone to the same issue.

    Regtested on rv64gcv_zvl512b.  As the two other cases don't have a test
    (so might not even trigger) I unconditionally enabled them for my testsuite
    run.

    Regards
     Robin

            PR target/118832

    gcc/ChangeLog:

            * config/riscv/riscv-v.cc (expand_const_vector):  Expand as
            vlmax insn during lra.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/autovec/pr118832.c: New test.

Reply via email to