< prev index next >

src/share/vm/opto/compile.cpp

Print this page
rev 9414 : 8217230: assert(t == t_no_spec) failure in NodeHash::check_no_speculative_types()
Summary: Remove dead node from C2 IR.
Reviewed-by: roland, neliasso

@@ -2082,17 +2082,20 @@
 
 // Remove edges from "root" to each SafePoint at a backward branch.
 // They were inserted during parsing (see add_safepoint()) to make
 // infinite loops without calls or exceptions visible to root, i.e.,
 // useful.
-void Compile::remove_root_to_sfpts_edges() {
+void Compile::remove_root_to_sfpts_edges(PhaseIterGVN& igvn) {
   Node *r = root();
   if (r != NULL) {
     for (uint i = r->req(); i < r->len(); ++i) {
       Node *n = r->in(i);
       if (n != NULL && n->is_SafePoint()) {
         r->rm_prec(i);
+        if (n->outcnt() == 0) {
+          igvn.remove_dead_node(n);
+        }
         --i;
       }
     }
   }
 }

@@ -2152,11 +2155,11 @@
     if (failing())  return;
   }
 
   // Now that all inlining is over, cut edge from root to loop
   // safepoints
-  remove_root_to_sfpts_edges();
+  remove_root_to_sfpts_edges(igvn);
 
   // Remove the speculative part of types and clean up the graph from
   // the extra CastPP nodes whose only purpose is to carry them. Do
   // that early so that optimizations are not disrupted by the extra
   // CastPP nodes.
< prev index next >