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

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

https://gcc.gnu.org/g:7e7cf425999bf7dd6bf342108b726670a52ff6d7

commit r17-7175-g7e7cf425999bf7dd6bf342108b726670a52ff6d7
Author: Jin Ma <[email protected]>
Date:   Thu Nov 26 19:17:13 2026 +0800

    RISC-V: Exclude XTheadMemIdx addresses from scalar atomics [PR127503]

    The generic memory constraint accepts indexed and writeback addresses
    when XTheadMemIdx is enabled.  The ordinary load and store opcodes in
    the atomic patterns cannot encode these addresses.  Use th_m_noi for
    their memory alternatives so they can still fold a displacement.

    Assisted-by: qwenwork

            PR target/127503

    gcc/ChangeLog:

            * config/riscv/sync-rvwmo.md (atomic_load_rvwmo<mode>)
            (atomic_load_rvwmo<X:mode><SUBX:mode><code>,
atomic_store_rvwmo<mode>):
            Use th_m_noi for ordinary loads and stores.
            * config/riscv/sync-ztso.md (atomic_load_ztso<mode>)
            (atomic_load_ztso<X:mode><SUBX:mode><code>,
atomic_store_ztso<mode>):
            Likewise.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/amo/atomic-load-offset-rvwmo.c: New test.
            * gcc.target/riscv/amo/atomic-load-offset-ztso.c: Likewise.

    Signed-off-by: Jin Ma <[email protected]>

Reply via email to