8136926: phi == NULL assert in PhaseIdealLoop::try_move_store_after_loop
authorroland
Tue, 22 Sep 2015 15:25:34 +0200
changeset 33078 9452eb89c16d
parent 33077 55f205e96044
child 33079 65fc34b22fdb
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
hotspot/src/share/vm/opto/loopopts.cpp
hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java
--- 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
  *
  */