JDK-8277906 : Incorrect type for IV phi of long counted loops after CCP
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16,17,18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-11-29
  • Updated: 2022-03-03
  • Resolved: 2021-12-02
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 18
17.0.4-oracleFixed 18 b27Fixed
Related Reports
Relates :  
Description
The attached fuzzer test produces a different result for C2 compared to C1/interpreter.

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

or

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

# Original output of Test.java
$ diff Xint.log c2.log
4c4
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
14c14
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
24c24
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
34c34
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
44c44
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
54c54
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
64c64
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
74c74
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
84c84
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
94c94
< f4 lArr iArr3 = 1296662437,-6368796162110135215,-68624
---
> f4 lArr iArr3 = 1296662437,-6368796162110135215,-115125
Comments
A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/187 Date: 2022-03-02 16:46:25 +0000
02-03-2022

Fix Request (17u) Should get backported for parity with 17.0.4-oracle. Applies cleanly.
02-03-2022

Changeset: 3889af3f Author: Roland Westrelin <roland@openjdk.org> Date: 2021-12-02 15:09:58 +0000 URL: https://git.openjdk.java.net/jdk/commit/3889af3f7debc4f8d75f620bb54134d1d11a6c83
02-12-2021

To reproduce, run: java -XX:-TieredCompilation -XX:CompileCommand=compileonly,Reduced2::test Reduced2.java
29-11-2021

I simplified the test further (see Reduced2.java) and verified that this is a regression from JDK-8256655 in JDK 16 b27.
29-11-2021

ILW = Wrong result with C2 compared to C1/interpreter and not recent regression, only single Java Fuzzer test, disable compilation of affected method = HLM = P3
29-11-2021