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

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Oct 12 19:22:08 UTC 2017


Yes, it is reasonable fix. We have other places where we check If's node outcnt().

May be move the check up to the method's beginning above Opcode() call which is virtual.

Thanks,
Vladimir

On 10/2/17 4:46 AM, Roland Westrelin wrote:
> 
> http://cr.openjdk.java.net/~roland/8188223/webrev.00/
> 
> I saw the following crash (that I cannot reproduce anymore having
> deleted the replay file by mistake).
> 
> With subgraph shape:
> 
> UNC->Region->IfProj->RangeCheck
> 
> The region has the IfProj as single input. The following code in
> RegionNode::Ideal():
> 
>    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.
> 
> Roland.
> 


More information about the hotspot-compiler-dev mailing list