8034216: assert(false) failed: infinite loop in PhaseIterGVN::optimize
authoranoll
Fri, 11 Apr 2014 11:33:00 +0200
changeset 24009 ec494183af7e
parent 24008 da7059252295
child 24010 e1761df99d5f
child 24013 1d16b0f1060d
8034216: assert(false) failed: infinite loop in PhaseIterGVN::optimize Summary: Eagerly remove all castPP nodes in PhaseCCP to get type convergence in memnode. Reviewed-by: kvn, roland
hotspot/src/share/vm/opto/phaseX.cpp
--- a/hotspot/src/share/vm/opto/phaseX.cpp	Thu Apr 10 23:15:13 2014 -0700
+++ b/hotspot/src/share/vm/opto/phaseX.cpp	Fri Apr 11 11:33:00 2014 +0200
@@ -1514,6 +1514,21 @@
   C->set_root( transform(C->root())->as_Root() );
   assert( C->top(),  "missing TOP node" );
   assert( C->root(), "missing root" );
+
+  // Eagerly remove castPP nodes here. CastPP nodes might not be
+  // removed in the subsequent IGVN phase if a node that changes
+  // in(1) of a castPP is processed prior to the castPP node.
+  for (uint i = 0; i < _worklist.size(); i++) {
+    Node* n = _worklist.at(i);
+
+    if (n->is_ConstraintCast()) {
+      Node* nn = n->Identity(this);
+      if (nn != n) {
+        replace_node(n, nn);
+        --i;
+      }
+    }
+  }
 }
 
 //------------------------------transform--------------------------------------