RFR(XS): 8188223: IfNode::range_check_trap_proj() should handler dying subgraph with single if proj

Roland Westrelin rwestrel at redhat.com
Mon Oct 2 11:46:37 UTC 2017


I saw the following crash (that I cannot reproduce anymore having
deleted the replay file by mistake).

With subgraph shape: 


The region has the IfProj as single input. The following code in

  if (can_reshape && cnt == 1) {
    // Is it dead loop?
    // If it is LoopNopde it had 2 (+1 itself) inputs and
    // one of them was cut. The loop is dead if it was EntryContol.
    // Loop node may have only one input because entry path
    // is removed in PhaseIdealLoop::Dominators().
    assert(!this->is_Loop() || cnt_orig <= 3, "Loop node should have 3 or less inputs");
    if ((this->is_Loop() && (del_it == LoopNode::EntryControl ||
                             (del_it == 0 && is_unreachable_region(phase)))) ||
        (!this->is_Loop() && has_phis && is_unreachable_region(phase))) {

finds that the subgraph is unreachable which causes the IfProj to be
removed. RangeCheckNode::Ideal() is later called on a dominated range
check which walks the graph, hit the RangeCheck that has a single
projection and causes a crash.

I think it makes sense to make IfNode::range_check_trap_proj() handle
the case of a RangeCheckNode with a single input.


More information about the hotspot-compiler-dev mailing list