RFR: JDK-8272570: C2: crash in PhaseCFG::global_code_motion [v3]

王超 github.com+25214855+casparcwang at openjdk.java.net
Thu Aug 19 04:17:23 UTC 2021


On Wed, 18 Aug 2021 08:12:19 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

> So this code assumes that the number of nodes per block does not change. Where did we add a new node?

Thank you for your review.

`schedule_local` will call `sched_call`, and it will create `MachProjNode`.  That's where node `35: MachProj` comes from. 


#0  Node::Init (this=0x7fff5805c910, req=1) at /data/openjdk/jdk_dev/src/hotspot/share/opto/node.cpp:309
#1  0x00007ffff62206a9 in Node::Node (this=0x7fff5805c910, n0=0x7fff58059ef0) at /data/openjdk/jdk_dev/src/hotspot/share/opto/node.cpp:356
#2  0x00007ffff56c7703 in ProjNode::ProjNode (this=0x7fff5805c910, src=0x7fff58059ef0, con=8, io_use=false) at /data/openjdk/jdk_dev/src/hotspot/share/opto/multnode.hpp:68
#3  0x00007ffff56c77b6 in MachProjNode::MachProjNode (this=0x7fff5805c910, multi=0x7fff58059ef0, con=8, out=..., ideal_reg=999) at /data/openjdk/jdk_dev/src/hotspot/share/opto/machnode.hpp:739
#4  0x00007ffff605e003 in PhaseCFG::sched_call (this=0x7fff981242d0, block=0x7fff5805bc68, node_cnt=6, worklist=..., ready_cnt=..., mcall=0x7fff58059ef0, next_call=...) at /data/openjdk/jdk_dev/src/hotspot/share/opto/lcm.cpp:863
#5  0x00007ffff605f258 in PhaseCFG::schedule_local (this=0x7fff981242d0, block=0x7fff5805bc68, ready_cnt=..., next_call=..., recalc_pressure_nodes=0x0) at /data/openjdk/jdk_dev/src/hotspot/share/opto/lcm.cpp:1148
#6  0x00007ffff5cf7951 in PhaseCFG::global_code_motion (this=0x7fff981242d0) at /data/openjdk/jdk_dev/src/hotspot/share/opto/gcm.cpp:1601
#7  0x00007ffff5cf7c0c in PhaseCFG::do_global_code_motion (this=0x7fff981242d0) at /data/openjdk/jdk_dev/src/hotspot/share/opto/gcm.cpp:1642
#8  0x00007ffff5a83eac in Compile::Code_Gen (this=0x7fff98126cb0) at /data/openjdk/jdk_dev/src/hotspot/share/opto/compile.cpp:2721
#9  0x00007ffff5a7b0ac in Compile::Compile (this=0x7fff98126cb0, ci_env=0x7fff98127a20, target=0x7fff580bc9f8, osr_bci=-1, subsume_loads=true, do_escape_analysis=true, eliminate_boxing=true, do_locks_coarsening=true, install_code=true, 
    directive=0x7ffff01f1b80) at /data/openjdk/jdk_dev/src/hotspot/share/opto/compile.cpp:829
#10 0x00007ffff5966b80 in C2Compiler::compile_method (this=0x7ffff02f0910, env=0x7fff98127a20, target=0x7fff580bc9f8, entry_bci=-1, install_code=true, directive=0x7ffff01f1b80) at /data/openjdk/jdk_dev/src/hotspot/share/opto/c2compiler.cpp:107
#11 0x00007ffff5a9831a in CompileBroker::invoke_compiler_on_method (task=0x7ffff04d7c00) at /data/openjdk/jdk_dev/src/hotspot/share/compiler/compileBroker.cpp:2290
#12 0x00007ffff5a96ead in CompileBroker::compiler_thread_loop () at /data/openjdk/jdk_dev/src/hotspot/share/compiler/compileBroker.cpp:1965
#13 0x00007ffff5ab77d7 in CompilerThread::thread_entry (thread=0x7ffff02f0f30, __the_thread__=0x7ffff02f0f30) at /data/openjdk/jdk_dev/src/hotspot/share/compiler/compilerThread.cpp:59
#14 0x00007ffff6530f97 in JavaThread::thread_main_inner (this=0x7ffff02f0f30) at /data/openjdk/jdk_dev/src/hotspot/share/runtime/thread.cpp:1269
#15 0x00007ffff6530e2d in JavaThread::run (this=0x7ffff02f0f30) at /data/openjdk/jdk_dev/src/hotspot/share/runtime/thread.cpp:1252
#16 0x00007ffff652e6d2 in Thread::call_run (this=0x7ffff02f0f30) at /data/openjdk/jdk_dev/src/hotspot/share/runtime/thread.cpp:360
#17 0x00007ffff6275e17 in thread_native_entry (thread=0x7ffff02f0f30) at /data/openjdk/jdk_dev/src/hotspot/os/linux/os_linux.cpp:720
#18 0x00007ffff79b0e25 in start_thread (arg=0x7fff98128700) at pthread_create.c:308
#19 0x00007ffff74d935d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

> test/hotspot/jtreg/compiler/c2/TestGCMRecalcPressureNodes.java line 31:
> 
>> 29:  * @requires vm.compiler2.enabled
>> 30:  *
>> 31:  * @run main/othervm TestGCMRecalcPressureNodes
> 
> Test can be executed in agent VM mode.

no, the test directly crashes with command `java TestGCMRecalcPressureNodes`. I will remove `othervm`

-------------

PR: https://git.openjdk.java.net/jdk/pull/5140


More information about the hotspot-compiler-dev mailing list