JDK-8371558 : C2: Missing optimization opportunity in AbsNode::Ideal
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-11-10
  • Updated: 2025-11-24
  • Resolved: 2025-11-13
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 b25Fixed
Related Reports
Causes :  
Relates :  
Description
java -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 Test_4691.java

Need to remove from hash before changing edges
  571  SubI  === _ 20 193  [[ 948 572 585 917 879 823 646 803 668 766 699 756 726 736 746 ]]  !jvms: Test_4691::mainTest @ bci:106 (line 128)
  585  AbsI  === _ 571  [[ 586 ]]  !jvms: Test_4691::mainTest @ bci:127 (line 129)
Set at i = 1
  193  Phi  === 186 130 246 41  [[ 1190 1190 371 1172 202 211 213 1172 1150 236 247 246 194 286 323 335 571 371 1150 1110 390 383 392 392 1110 1073 411 411 421 421 431 431 441 441 451 451 1073 1007 507 507 543 543 556 556 1007 997 997 987 987 977 977 967 646 646 967 194 668 668 917 917 699 699 879 879 726 726 736 736 746 746 756 756 766 766 803 803 823 823 ]]  #int !orig=[570] !jvms: Test_4691::mainTest @ bci:194 (line 135)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/phaseX.cpp:3352), pid=851039, tid=851058
#  assert(false) failed: Need to remove from hash before changing edges
#
# JRE version: Java(TM) SE Runtime Environment (26.0+21) (fastdebug build 26-ea+21-2147)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-ea+21-2147, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x185ddf5]  Node::set_req_X(unsigned int, Node*, PhaseIterGVN*)+0x1e5

Current CompileTask:
C2:2443  109 %  b        Test_4691::mainTest @ 194 (657 bytes)

Stack: [0x0000753955200000,0x0000753955300000],  sp=0x00007539552fae00,  free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x185ddf5]  Node::set_req_X(unsigned int, Node*, PhaseIterGVN*)+0x1e5  (phaseX.cpp:3352)
V  [libjvm.so+0x1aafc29]  AbsNode::Ideal(PhaseGVN*, bool)+0x89
V  [libjvm.so+0x186469d]  PhaseIterGVN::verify_Ideal_for(Node*, bool)+0x10d
V  [libjvm.so+0x18655d1]  PhaseIterGVN::verify_optimize()+0x831
V  [libjvm.so+0x1866328]  PhaseIterGVN::optimize()+0x418
V  [libjvm.so+0xb85c9e]  Compile::Optimize()+0x32e
V  [libjvm.so+0xb897e3]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x2023
V  [libjvm.so+0x9a37b3]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4a3
V  [libjvm.so+0xb98cf0]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780
V  [libjvm.so+0xb9a550]  CompileBroker::compiler_thread_loop()+0x530
V  [libjvm.so+0x10f1f0b]  JavaThread::thread_main_inner()+0x13b
V  [libjvm.so+0x1b62fd6]  Thread::call_run()+0xb6
V  [libjvm.so+0x17cff88]  thread_native_entry(Thread*)+0x128

Probably related to the optimization added by JDK-8276673.
Comments
Changeset: 9d6a61fd Branch: master Author: BenoƮt Maillard <bmaillard@openjdk.org> Date: 2025-11-13 09:24:51 +0000 URL: https://git.openjdk.org/jdk/commit/9d6a61fda6f43577ee8f19483e5b47100ff8eec0
13-11-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28237 Date: 2025-11-11 14:42:43 +0000
11-11-2025

ILW = Missed optimization opportunity, single fuzzer case and only observed with verification flag, disable VerifyIterativeGVN=1110 = MLH = P4
10-11-2025