changeset 53077:a5a3822a7239

8217230: assert(t == t_no_spec) failure in NodeHash::check_no_speculative_types() Summary: Remove dead node from C2 IR. Reviewed-by: roland, neliasso
author thartmann
date Wed, 25 Mar 2020 16:33:55 +0100
parents 49a0f59ecd0f
children 703b60c0f932
files src/hotspot/share/opto/compile.cpp src/hotspot/share/opto/compile.hpp
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/compile.cpp	Tue Nov 06 10:10:18 2018 -0800
+++ b/src/hotspot/share/opto/compile.cpp	Wed Mar 25 16:33:55 2020 +0100
@@ -2174,13 +2174,16 @@
 // 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;
       }
     }
@@ -2250,7 +2253,7 @@
 
   // 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
--- a/src/hotspot/share/opto/compile.hpp	Tue Nov 06 10:10:18 2018 -0800
+++ b/src/hotspot/share/opto/compile.hpp	Wed Mar 25 16:33:55 2020 +0100
@@ -1096,7 +1096,7 @@
   void inline_string_calls(bool parse_time);
   void inline_boxing_calls(PhaseIterGVN& igvn);
   bool optimize_loops(int& loop_opts_cnt, PhaseIterGVN& igvn, LoopOptsMode mode);
-  void remove_root_to_sfpts_edges();
+  void remove_root_to_sfpts_edges(PhaseIterGVN& igvn);
 
   // Matching, CFG layout, allocation, code generation
   PhaseCFG*         cfg()                       { return _cfg; }