JDK-8278420 : C2: Graph is broken due to missing skeleton predicates after peeled iteration
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,18,19,20
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2021-12-08
  • Updated: 2022-11-14
  • Resolved: 2022-11-14
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 20
20Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The attached Java Fuzzer test crashes with the following assertion:

To reproduce:
$ java -Xcomp -XX:CompileOnly=Test Test.java
$ java -Xcomp -XX:CompileOnly=Reduced -XX:LoopMaxUnroll=0 -XX:-LoopUnswitching Reduced.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/ff806ead-2cac-495d-9cbc-62116f99bf14-S13700/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8f731315-8676-4d9a-b759-a859429b8bf4/runs/73843d3e-ae06-4fbd-97ab-7296fb2593fc/workspace/open/src/hotspot/share/opto/loopopts.cpp:1488), pid=23439, tid=23453
#  assert(!n->is_Store() && !n->is_LoadStore()) failed: no node with a side effect
#
# JRE version: Java(TM) SE Runtime Environment (18.0+26) (fastdebug build 18-ea+26-1787)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-ea+26-1787, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x13a089f]  PhaseIdealLoop::try_sink_out_of_loop(Node*)+0xa0f
.........
Command Line: -Xmx1G -Xcomp -Xbatch -XX:CompileOnly=Test -XX:CompileCommand=quiet Test
.........
Current thread (0x00007fb2a43926f0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=23453, stack(0x00007fb27acff000,0x00007fb27ae00000)]


Current CompileTask:
C2:   3859   18 %  b  4       Test::mainTest @ 223 (683 bytes)

Stack: [0x00007fb27acff000,0x00007fb27ae00000],  sp=0x00007fb27adf9e60,  free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x13a089f]  PhaseIdealLoop::try_sink_out_of_loop(Node*)+0xa0f
V  [libjvm.so+0x13a0a2c]  PhaseIdealLoop::split_if_with_blocks_post(Node*)+0x5c
V  [libjvm.so+0x13a17b1]  PhaseIdealLoop::split_if_with_blocks(VectorSet&, Node_Stack&)+0x201
V  [libjvm.so+0x1394993]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x1333
V  [libjvm.so+0xa9485a]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x28a
V  [libjvm.so+0xa910e8]  Compile::Optimize()+0x15d8
V  [libjvm.so+0xa92d9e]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x159e
V  [libjvm.so+0x8ab5a4]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x664
V  [libjvm.so+0xaa3098]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xc88
V  [libjvm.so+0xaa3e58]  CompileBroker::compiler_thread_loop()+0x648
V  [libjvm.so+0x192745a]  JavaThread::thread_main_inner()+0x25a
V  [libjvm.so+0x192f820]  Thread::call_run()+0x100
V  [libjvm.so+0x1611f24]  thread_native_entry(Thread*)+0x104
Comments
Found more problems with loop peeling and loop predication which requires a more sophisticated and higher risk fix (see: https://github.com/openjdk/jdk18/pull/11#issuecomment-995935019). Given how rare it is, I think it's best to defer this bug to 19.
16-12-2021

Starts to fail after JDK-8272873 but that change seems to be unrelated and must have just revealed an existing issue.
08-12-2021

ILW = C2 assertion in split if, only single fuzzer test, disable compilation of affected method or use -XX:-SplitIfBlocks = HLM = P3
08-12-2021