hotspot/src/share/vm/opto/phaseX.cpp
changeset 24016 2927072ed5fb
parent 24015 e54063b2eb53
parent 24009 ec494183af7e
child 24424 2658d7834c6e
--- a/hotspot/src/share/vm/opto/phaseX.cpp	Mon Apr 14 10:57:07 2014 +0200
+++ b/hotspot/src/share/vm/opto/phaseX.cpp	Mon Apr 14 09:04:36 2014 +0000
@@ -1529,6 +1529,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--------------------------------------