--- old/src/hotspot/share/opto/loopnode.cpp 2018-01-12 12:55:42.698589436 +0100 +++ new/src/hotspot/share/opto/loopnode.cpp 2018-01-12 12:55:41.254588314 +0100 @@ -1394,9 +1394,14 @@ Node* uu = fast_out(j); if (uu->is_Phi()) { Node* be = uu->in(LoopNode::LoopBackControl); - while (be->is_Store() && old_new[be->_idx] != NULL) { - ShouldNotReachHere(); - be = be->in(MemNode::Memory); + if (be->is_Store() && old_new[be->_idx] != NULL) { + assert(false, "store on the backedge + sunk stores: unsupported"); + // drop outer loop + IfNode* outer_le = outer_loop_end(); + Node* iff = igvn->transform(new IfNode(outer_le->in(0), outer_le->in(1), outer_le->_prob, outer_le->_fcnt)); + igvn->replace_node(outer_le, iff); + inner_cl->clear_strip_mined(); + return; } if (be == last || be == first->in(MemNode::Memory)) { assert(phi == NULL, "only one phi"); @@ -1449,10 +1454,7 @@ // Or fix the outer loop fix to include // that chain of stores. Node* be = phi->in(LoopNode::LoopBackControl); - while (be->is_Store() && old_new[be->_idx] != NULL) { - ShouldNotReachHere(); - be = be->in(MemNode::Memory); - } + assert(!(be->is_Store() && old_new[be->_idx] != NULL), "store on the backedge + sunk stores: unsupported"); if (be == first->in(MemNode::Memory)) { if (be == phi->in(LoopNode::LoopBackControl)) { igvn->replace_input_of(phi, LoopNode::LoopBackControl, last);