# HG changeset patch # User roland # Date 1442928334 -7200 # Node ID 9452eb89c16dd00a033f695d3be0d5769d0d8484 # Parent 55f205e96044add3820dd09a93640e7203cfeb30 8136926: phi == NULL assert in PhaseIdealLoop::try_move_store_after_loop Summary: multiple phis on same slice are possible in a loop Reviewed-by: kvn, mcberg diff -r 55f205e96044 -r 9452eb89c16d hotspot/src/share/vm/opto/loopopts.cpp --- a/hotspot/src/share/vm/opto/loopopts.cpp Mon Sep 21 10:51:33 2015 +0200 +++ b/hotspot/src/share/vm/opto/loopopts.cpp Tue Sep 22 15:25:34 2015 +0200 @@ -775,13 +775,15 @@ } if (u->is_Phi() && u->in(0) == n_loop->_head) { assert(_igvn.type(u) == Type::MEMORY, "bad phi"); - assert(phi == NULL, "already found"); + // multiple phis on the same slice are possible + if (phi != NULL) { + return; + } phi = u; continue; } } - phi = NULL; - break; + return; } if (phi != NULL) { // Nothing in the loop before the store (next iteration) diff -r 55f205e96044 -r 9452eb89c16d hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java --- a/hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java Mon Sep 21 10:51:33 2015 +0200 +++ b/hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java Tue Sep 22 15:25:34 2015 +0200 @@ -25,8 +25,8 @@ /** * @test * @bug 8080289 - * @summary Sink stores out of loops if possible - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+PrintCompilation -XX:CompileCommand=dontinline,TestMoveStoresOutOfLoops::test* TestMoveStoresOutOfLoops + * @summary Move stores out of loops if possible + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestMoveStoresOutOfLoops::test* TestMoveStoresOutOfLoops * */