Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8342014

RISC-V: ZStoreBarrierStubC2 clobbers rflags

XMLWordPrintable

    • b20
    • riscv
    • linux

        ZStoreBarrierStubC2 (ZBarriersetAssembler::generate_c2_store_barrier_stub) clobbers rflags (the t1 register) on riscv [1].
        And ZStoreBarrierStubC2 is used by z_store_barrier in file gc/z/z_riscv.ad. But the calling instructs in the same ad file
        didn't list the rflags as being killed. As the call chain is not simple, this kind of problem could go silently unnoticed.
        I would suggest we add clobbering of rflags for all gc-related C2 instructs. This would help reduce the risk of another
        PR: https://github.com/openjdk/jdk/pull/21406 which touches g1/x/z prefering t1 for performance reasons.

        [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp#L746

              fyang Fei Yang
              fyang Fei Yang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: