--- old/src/share/vm/opto/loopopts.cpp 2015-09-25 16:46:45.521774092 +0200 +++ new/src/share/vm/opto/loopopts.cpp 2015-09-25 16:46:44.971882681 +0200 @@ -206,7 +206,7 @@ // prevdom is the dominating projection of the dominating test. assert( iff->is_If(), "" ); - assert( iff->Opcode() == Op_If || iff->Opcode() == Op_CountedLoopEnd, "Check this code when new subtype is added"); + assert(iff->Opcode() == Op_If || iff->Opcode() == Op_CountedLoopEnd || iff->Opcode() == Op_RangeCheck, "Check this code when new subtype is added"); int pop = prevdom->Opcode(); assert( pop == Op_IfFalse || pop == Op_IfTrue, "" ); if (flip) { @@ -1119,7 +1119,8 @@ int n_op = n->Opcode(); // Check for an IF being dominated by another IF same test - if (n_op == Op_If) { + if (n_op == Op_If || + n_op == Op_RangeCheck) { Node *bol = n->in(1); uint max = bol->outcnt(); // Check for same test used more than once? @@ -1940,8 +1941,11 @@ BoolNode* bol = new BoolNode(cmp, relop); register_node(bol, loop, proj2, ddepth); - - IfNode* new_if = new IfNode(proj2, bol, iff->_prob, iff->_fcnt); + + int opcode = iff->Opcode(); + assert(opcode == Op_If || opcode == Op_RangeCheck, ""); + IfNode* new_if = opcode == Op_If ? new IfNode(proj2, bol, iff->_prob, iff->_fcnt): + new RangeCheckNode(proj2, bol, iff->_prob, iff->_fcnt); register_node(new_if, loop, proj2, ddepth); proj->set_req(0, new_if); // reattach