RFR: 8320807: [PPC64][ZGC] C1 generates wrong code for atomics
Lutz Schmidt
lucy at openjdk.org
Fri Dec 1 11:09:05 UTC 2023
On Mon, 27 Nov 2023 21:52:53 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
> Debugging test failures on PPC64 in java/lang/Thread/virtual/stress/Skynet.java#ZGenerational has shown that the ldarx+stdcx_ loop for uncompressed Oops in `LIR_Assembler::atomic_op` is wrong: `__ mr(Rtmp, Robj);` is inside of the ldarx+stdcx_ loop, but must be outside of it. Repeated execution leads to wrong store value.
> In addition, zBarrierSetC1.cpp expects `cas_obj` and `xchg` to contain all necessary memory barriers. That doesn't fit to the current PPC64 design which inserts memory barriers on LIR level instead. I've changed this and moved them into the assembler code for all GCs.
> While debugging, I have optimized out an unnecessary branch in `ZBarrierSetAssembler::store_barrier_medium`.
Looks good.
Thanks for detecting and fixing this bug.
-------------
Marked as reviewed by lucy (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16835#pullrequestreview-1759560030
More information about the shenandoah-dev
mailing list