JDK-8305324 : C2: Wrong execution of vectorizing Interger.reverseBytes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19,20,21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-03-30
  • Updated: 2023-04-20
  • Resolved: 2023-04-12
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 21
21 b19Fixed
Related Reports
Relates :  
Relates :  
Description
The attached Java Fuzzer test produces a wrong result after JDK-8288112:

To reproduce:
$ java -Xint Test.java > int.log
$ java -XX:-TieredCompilation -Xcomp -XX:CompileOnly=Test Test.java > c2.log
$ diff int.log c2.log

$ java -Xint Reduced.java > int.log
$ java -XX:-TieredCompilation -Xcomp -XX:CompileOnly=Reduced Reduced.java > c2.log
$ diff int.log c2.log

Output diff of Test.java:
0a1
> CompileCommand: compileonly Test.* bool compileonly = true
16c17
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1765
27c28
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
38c39
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
49c50
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
60c61
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
71c72
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
82c83
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
93c94
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
104c105
< i24 i25 byArr = 2,-3,-1381
---
> i24 i25 byArr = 2,-3,-1553
Comments
Changeset: 19380d74 Author: quadhier <quadhier@163.com> Committer: Vladimir Kozlov <kvn@openjdk.org> Date: 2023-04-12 17:08:26 +0000 URL: https://git.openjdk.org/jdk/commit/19380d74e437c17c4d8292e2adfd0fb20f059bb0
12-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13406 Date: 2023-04-10 13:21:29 +0000
10-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13404 Date: 2023-04-10 10:49:24 +0000
10-04-2023

[~jbhateja] can you have a look?
30-03-2023

ILW = Wrong execution of C2 compiled code, single fuzzer test and only when using Interger.reverseBytes(), disable compilation of affected method or use -XX:-UseSuperWord = HLM = P3
30-03-2023