RFR: 8370049: [s390x] G1 barrier compareAndExchange does not return old value when compareExchange fails

Vladimir Petko vpetko at openjdk.org
Fri Oct 17 01:54:34 UTC 2025


This PR fixes typo in `src/hotspot/cpu/s390/gc/g1/g1_s390.ad` that caused `compareAndExchange` return expected value instead of old value when compareAndExchange failed.
It updates jtreg test to include negative tests for compareAndExchange and compareAndSwap g1 barriers.

Testing (s390x) :

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
   jtreg:test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java
                                                         1     1     0     0     0   
==============================
TEST SUCCESS

Tier1 summary:

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
   jtreg:test/hotspot/jtreg:tier1                     3118  2466     0     0   652   
   jtreg:test/jdk:tier1                               2518  2418     0     0   100   
   jtreg:test/langtools:tier1                         4672  4662     0     0    10   
   jtreg:test/jaxp:tier1                                 0     0     0     0     0   
   jtreg:test/lib-test:tier1                            38    38     0     0     0   
==============================
TEST SUCCESS


Tier 2 tests contain unrelated failures:

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
>> jtreg:test/hotspot/jtreg:tier2                      960   766     1     0   193 <<
>> jtreg:test/jdk:tier2                               4455  4203     5     0   247 <<
   jtreg:test/langtools:tier2                           14    12     0     0     2   
   jtreg:test/jaxp:tier2                               517   516     0     0     1   
   jtreg:test/docs:tier2                                 4     0     0     0     4   
==============================
TEST FAILURE

jtreg:test/hotspot/jtreg:tier2:
1. ``applications/ctw/modules/jdk_jfr.java                                                      Failed. Execution failed: `main' threw exception: java.lang.AssertionError: There were 1 errors:[{modules_jdk_jfr_0: failed during compilation of class #226 : jdk/jfr/internal/jfc/JFC}]`` - existing issue https://bugs.openjdk.org/browse/JDK-8352567 

jtreg:test/jdk:tier2:
1. ``java/net/Inet6Address/B6206527.java                                                                      Failed. Execution failed: `main' threw exception: java.net.SocketException: Duplicate link local addresses: must specify scope-id``
2. ``java/net/Inet6Address/Scoping.java                                                                       Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Failed: /[fe80:0:0:0:ca:9ff:fe00:6d0c]:0count: 0``
3. ``java/net/NetworkInterface/UniqueMacAddressesTest.java                                                    Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: mac address uniqueness test failed``
4. ``tools/launcher/HelpFlagsTest.java                                                                        Failed. Execution failed: `main' threw exception: java.lang.AssertionError: HelpFlagsTest failed: Tool jrunscript not covered by this test. Add specification to jdkTools array!``
5. ``tools/launcher/VersionCheck.java                                                                         Failed. Execution failed: `main' threw exception: java.lang.AssertionError: VersionCheck failed: testToolVersion: [jrunscript];``

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

Commit messages:
 - test: clean up test code
 - fix(s390x): return cas operation result instead of the expected value

Changes: https://git.openjdk.org/jdk/pull/27857/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27857&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8370049
  Stats: 21 lines in 2 files changed: 20 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/27857.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27857/head:pull/27857

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


More information about the hotspot-dev mailing list