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

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

https://gcc.gnu.org/g:2f84ad4ddc2a2dc93584d87da347c444a77f429c

commit r16-7404-g2f84ad4ddc2a2dc93584d87da347c444a77f429c
Author: Jeff Law <[email protected]>
Date:   Sun Feb 8 08:23:07 2026 -0700

    [PR target/123911][RISC-V] Fix infinite recursion in riscv_legitimize_move

    I kept hoping I'd see a better solution, perhaps one where chunks of this
    routine just go away, but that hasn't materialized.  So...

    This patch avoids infinite recursion through riscv_legitimize_move.
    Essentially we end up calling it recursively with arguments that are a
nop-move
    and those particular arguments trigger infinite recursion.

    So this patch just recognizes and elides the nop move.   Bootstrapped on
    riscv64-linux-gnu and regression tested on riscv{32,64}-elf with no
    regressions.  Pushing to the trunk.

            PR target/123911
    gcc/
            * config/riscv/riscv.cc (riscv_legitimize_move): Elide nop moves to
            avoid infinite recursion.

    gcc/testsuite/
            * gcc.target/riscv/pr123911.c: New test.

Reply via email to