diff -r 4a575a49e938 -r 09d0d56ca735 src/share/vm/opto/loopTransform.cpp --- a/src/share/vm/opto/loopTransform.cpp Thu Jun 01 20:42:49 2017 -0400 +++ b/src/share/vm/opto/loopTransform.cpp Thu Jun 01 23:19:47 2017 -0700 @@ -2714,6 +2714,11 @@ return false; } + Node* exit = head->loopexit()->proj_out(0); + if (exit == NULL) { + return false; + } + #ifndef PRODUCT if (TraceLoopOpts) { tty->print("ArrayFill "); @@ -2831,7 +2836,6 @@ */ // Redirect the old control and memory edges that are outside the loop. - Node* exit = head->loopexit()->proj_out(0); // Sometimes the memory phi of the head is used as the outgoing // state of the loop. It's safe in this case to replace it with the // result_mem.