Integrated: 8320807: [PPC64][ZGC] C1 generates wrong code for atomics

Martin Doerr mdoerr at openjdk.org
Fri Dec 1 14:47:17 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`.

This pull request has now been integrated.

Changeset: 3087e14c
Author:    Martin Doerr <mdoerr at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3087e14cde9257680f0406b11942f9cb7739cb7b
Stats:     121 lines in 4 files changed: 42 ins; 70 del; 9 mod

8320807: [PPC64][ZGC] C1 generates wrong code for atomics

Reviewed-by: lucy, rrich

-------------

PR: https://git.openjdk.org/jdk/pull/16835


More information about the shenandoah-dev mailing list