--- old/src/share/vm/opto/loopTransform.cpp 2016-02-15 16:51:54.937120928 +0100 +++ new/src/share/vm/opto/loopTransform.cpp 2016-02-15 16:51:54.857120932 +0100 @@ -1454,13 +1454,26 @@ if (adjust_min_trip) { // If not maximally unrolling, need adjustment // Search for zero-trip guard. assert( loop_head->is_main_loop(), "" ); - assert( ctrl->Opcode() == Op_IfTrue || ctrl->Opcode() == Op_IfFalse, "" ); + // In some cases, the shape of the graph does not match the shape + // outlined below (because other optimizations, e.g., split-if and loop + // peeling have transformed it). Loop unrolling is not possible in these + // cases, so give up on the attempt to unroll the loop (but still continue + // compilation). + if (ctrl->Opcode() != Op_IfTrue && ctrl->Opcode() != Op_IfFalse) { + return; + } Node *iff = ctrl->in(0); - assert( iff->Opcode() == Op_If, "" ); + if (iff->Opcode() != Op_If) { + return; + } Node *bol = iff->in(1); - assert( bol->Opcode() == Op_Bool, "" ); + if (bol->Opcode() != Op_Bool) { + return; + } Node *cmp = bol->in(1); - assert( cmp->Opcode() == Op_CmpI, "" ); + if (cmp->Opcode() != Op_CmpI) { + return; + } opaq = cmp->in(2); // Occasionally it's possible for a zero-trip guard Opaque1 node to be // optimized away and then another round of loop opts attempted.