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
--- 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)
--- 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
*
*/