8066763: fatal error "assert(false) failed: unexpected yanked node" in postaloc.cpp:139
authorthartmann
Fri, 12 Dec 2014 09:07:54 +0100
changeset 28188 08f2d6e29ceb
parent 28046 c3c8e3a87fb1
child 28189 9c1d965a911c
8066763: fatal error "assert(false) failed: unexpected yanked node" in postaloc.cpp:139 Summary: Check for dead input nodes after replacing compare node with implicit null check. Reviewed-by: kvn
hotspot/src/share/vm/opto/lcm.cpp
--- a/hotspot/src/share/vm/opto/lcm.cpp	Tue Dec 09 21:33:51 2014 +0000
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Fri Dec 12 09:07:54 2014 +0100
@@ -417,8 +417,15 @@
   for (DUIterator_Last i2min, i2 = old_tst->last_outs(i2min); i2 >= i2min; --i2)
     old_tst->last_out(i2)->set_req(0, nul_chk);
   // Clean-up any dead code
-  for (uint i3 = 0; i3 < old_tst->req(); i3++)
+  for (uint i3 = 0; i3 < old_tst->req(); i3++) {
+    Node* in = old_tst->in(i3);
     old_tst->set_req(i3, NULL);
+    if (in->outcnt() == 0) {
+      // Remove dead input node
+      in->disconnect_inputs(NULL, C);
+      block->find_remove(in);
+    }
+  }
 
   latency_from_uses(nul_chk);
   latency_from_uses(best);