JDK-8316679 : C2 SuperWord: wrong result, load should not be moved before store if not comparable
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,21,22
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-09-21
  • Updated: 2024-01-09
  • Resolved: 2023-10-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 21 JDK 22
17.0.11-oracleFixed 21.0.2Fixed 22 b18Fixed
Related Reports
Blocks :  
Relates :  
Description
./java -XX:CompileCommand=compileonly,Test25::test25 -XX:CompileCommand=printcompilation,Test25::test* -XX:LoopUnrollLimit=100 -Xbatch -XX:-TraceSuperWord -XX:+StressLCM -XX:+TraceNewVectors -XX:+TraceLoopOpts -XX:LoopMaxUnroll=8 Test25.java

Exception in thread "main" java.lang.RuntimeException: bad a
	at Test25.verify(Test25.java:40)
	at Test25.main(Test25.java:26)

Found this bug when inspecting code change made in JDK-8052081:
https://github.com/openjdk/jdk/commit/7764490363a5963212e040baa2b79946cf4487bf
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2071 Date: 2023-12-21 16:04:28 +0000
21-12-2023

Fix request [17u] I backport this for parity with 17.0.11-oracle. Typical risk of a C2 change, but good repro case. We should take it. Resolves needed because of code changes in the context Test passes and fails without the fix.
21-12-2023

[jdk21u-fix-request] Approval Request from Aleksey Shipilëv Unclean backport to fix the vectorization bug. The patch is unclean because JDK 21u does not have JDK-8312332 refactoring, that I do not want to backport. JDK 21u PR is acked by Emanuel Peter.
06-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u/pull/327 Date: 2023-11-06 15:40:00 +0000
06-11-2023

Changeset: 48f1a925 Author: Emanuel Peter <epeter@openjdk.org> Date: 2023-10-04 07:54:30 +0000 URL: https://git.openjdk.org/jdk/commit/48f1a925e528cc9f8cd6c727129918e0e49b3429
04-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15864 Date: 2023-09-21 14:19:58 +0000
22-09-2023

ILW = Incorrect execution with C2 compiled code, single test with non-default VM arguments, -XX:-UseSuperWord or disable compilation of affected method = HLM = P3
22-09-2023