JDK-8343137 : C2: VerifyLoopOptimizations fails with "Was reachable in only one"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-10-28
  • Updated: 2024-11-03
  • Resolved: 2024-10-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 24
24 b22Fixed
Related Reports
Relates :  
Relates :  
Description
java -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xcomp -XX:+VerifyLoopOptimizations Test.java

Was reachable in only one. this 0, verify 1.
  44  ConI  === 0  [[ 499 488 ]]  #int:1
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/loopnode.cpp:5034), pid=1837392, tid=1837406
#  assert(success) failed: VerifyLoopOptimizations failed
#
# JRE version: Java(TM) SE Runtime Environment (24.0+22) (fastdebug build 24-ea+22-2571)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-ea+22-2571, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x12f1932]  PhaseIdealLoop::verify() const+0x4c2

Current CompileTask:
C2:2652   89    b        Test::iMeth (231 bytes)

Stack: [0x00007d300a300000,0x00007d300a400000],  sp=0x00007d300a3fac50,  free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x12f1932]  PhaseIdealLoop::verify() const+0x4c2  (loopnode.cpp:5034)
V  [libjvm.so+0x12f28fd]  PhaseIdealLoop::build_and_optimize()+0xf5d
V  [libjvm.so+0xa37e58]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3a8
V  [libjvm.so+0xa30ea4]  Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0x74
V  [libjvm.so+0xa31c2c]  Compile::Optimize()+0xabc
V  [libjvm.so+0xa35b83]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1b23
V  [libjvm.so+0x880435]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1d5
V  [libjvm.so+0xa41a18]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928
V  [libjvm.so+0xa426a8]  CompileBroker::compiler_thread_loop()+0x478
V  [libjvm.so+0xef257c]  JavaThread::thread_main_inner()+0xcc
V  [libjvm.so+0x181d0e6]  Thread::call_run()+0xb6
V  [libjvm.so+0x14feba8]  thread_native_entry(Thread*)+0x128

Comments
Changeset: e389f82b Branch: master Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2024-10-29 08:07:22 +0000 URL: https://git.openjdk.org/jdk/commit/e389f82b1b2365a43fef744936b222328d71494b
29-10-2024

ILW = Assert during loop opts verification in C2 (most likely harmless but regression in JDK 24), JavaFuzzer generated test with -XX:+VerifyLoopOptimizations, no workaround but disable compilation of affected method = MMH = P3
28-10-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21739 Date: 2024-10-28 12:41:02 +0000
28-10-2024