JDK-8359603 : Missed optimization in PhaseIterGVN for redundant ConvX2Y->ConvY2X->ConvX2Y sequences due to missing notification in PhaseIterGVN::add_users_of_use_to_worklist
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-06-15
  • Updated: 2025-08-02
  • Resolved: 2025-07-29
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 26
26 b09Fixed
Related Reports
Relates :  
Description
Missed Identity optimization:
Old node:
dist dump
---------------------------------------------
   1  1240  ConvL2D  === _ 1246  [[ 1233 1231 1245 942 1243 885 ]]  #double !orig=[886],[715],[228],502 !jvms: Test::vMeth1 @ bci:71 (line 31)
   0   885  ConvD2L  === _ 1240  [[ 873 ]]  #long !orig=[714],[368] !jvms: Test::vMeth1 @ bci:138 (line 37)
New node:
dist dump
---------------------------------------------
   1  1245  Phi  === 880 1241 1240  [[ 1246 ]]  #double !orig=[1239],[886],[715],[228],502 !jvms: Test::vMeth1 @ bci:71 (line 31)
   0  1246  ConvD2L  === _ 1245  [[ 1240 ]]  #long !orig=[1239],[886],[715],[228],502 !jvms: Test::vMeth1 @ bci:71 (line 31)

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:\sb\prod\1749899778\workspace\open\src\hotspot\share\opto\phaseX.cpp:1105), pid=43216, tid=28112
#  assert(!failure) failed: Missed optimization opportunity in PhaseIterGVN
#
# JRE version: Java(TM) SE Runtime Environment (26.0+3) (fastdebug build 26-ea+3-151)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-ea+3-151, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0xe331bc]  PhaseIterGVN::verify_optimize+0x65c
#
# Core dump will be written. Default location: C:\sb\prod\1749929752\testoutput\test-support\jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_MediumTest_java\tmpfuzzer.tmp.A8LDlH8i12\hs_err_pid43216.mdmp
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=10542763 -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:+StressMacroExpansion -XX:+VerifyLoopOptimizations -XX:VerifyIterativeGVN=1110 -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=c:\ade\mesos\work_dir\jib-master\install\jdk\24\36\bundles\windows-x64\jdk-24_windows-x64_bin.zip\jdk-24 -Djava.io.tmpdir=c:\sb\prod\1749929752\testoutput\test-support\jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_MediumTest_java\tmp -XX:+CreateCoredumpOnCrash Test

Host: AMD EPYC 7J13 64-Core Processor                , 12 cores, 23G,  Windows Server 2019 , 64 bit Build 17763 (10.0.17763.7009)
Time: Sat Jun 14 21:17:43 2025 /GM elapsed time: 1.115083 seconds (0d 0h 0m 1s)

---------------  T H R E A D  ---------------

Current thread (0x00000200149731f0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=28112, stack(0x000000057e600000,0x000000057e700000) (1024K)]


Current CompileTask:
C2:1115    6    b        Test::mainTest (544 bytes)

Stack: [0x000000057e600000,0x000000057e700000],  sp=0x000000057e6fb520,  free space=1005k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xe331bc]  PhaseIterGVN::verify_optimize+0x65c  (phaseX.cpp:1105)
V  [jvm.dll+0xe2d446]  PhaseIterGVN::optimize+0x446  (phaseX.cpp:1070)
V  [jvm.dll+0x5c7050]  PhaseIdealLoop::optimize+0x190  (loopnode.hpp:1269)
V  [jvm.dll+0x5b85a0]  Compile::Optimize+0x880  (compile.cpp:2469)
V  [jvm.dll+0x5b564a]  Compile::Compile+0x10fa  (compile.cpp:869)
V  [jvm.dll+0x4b98b9]  C2Compiler::compile_method+0x179  (c2compiler.cpp:144)
V  [jvm.dll+0x5d3abe]  CompileBroker::invoke_compiler_on_method+0x7ae  (compileBroker.cpp:2323)
V  [jvm.dll+0x5d0e0f]  CompileBroker::compiler_thread_loop+0x32f  (compileBroker.cpp:1968)
V  [jvm.dll+0x924b48]  JavaThread::thread_main_inner+0x288  (javaThread.cpp:774)
V  [jvm.dll+0x1030002]  Thread::call_run+0x1b2  (thread.cpp:248)
V  [jvm.dll+0xde2d41]  thread_native_entry+0xe1  (os_windows.cpp:562)
C  [ucrtbase.dll+0x2268a]  (no source info available)
C  [KERNEL32.DLL+0x17ac4]  (no source info available)
C  [ntdll.dll+0x5a8c1]  (no source info available)
Comments
Changeset: 28297411 Branch: master Author: BenoƮt Maillard <bmaillard@openjdk.org> Committer: Christian Hagedorn <chagedorn@openjdk.org> Date: 2025-07-29 07:32:52 +0000 URL: https://git.openjdk.org/jdk/commit/28297411b19551dd8585165200f5f8158f3d5bb3
29-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26368 Date: 2025-07-17 12:25:33 +0000
21-07-2025

I simplified the test: java -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,TestSimple::test -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 TestSimple.java
16-06-2025

ILW = C2 assertion failure in IGVN verification only affecting debug, single fuzzer test and only with -XX:VerifyIterativeGVN=1110, no workaround but use different value for -XX:VerifyIterativeGVN = MLM = P4
16-06-2025

This is an existing issue found by the new verification code from JDK-8347273. It was enabled by default with JDK-8359355. I used JDK-8359494 for backing out JDK-8359355 again. The issue should still be fixed, re-opening this issue.
16-06-2025

Reproduces with attached Test: java -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=2031718587 -Xbatch -XX:+StressIGVN -XX:VerifyIterativeGVN=1110 Test.java
16-06-2025

I now see JDK-8359494 was already filed.
16-06-2025

It is the same as JDK-8359494. Same 2 failure modes.
15-06-2025