8217230: assert(t == t_no_spec) failure in NodeHash::check_no_speculative_types()
Summary: Remove dead node from C2 IR.
Reviewed-by: roland, neliasso
--- a/src/hotspot/share/opto/compile.cpp Tue Jan 22 09:27:19 2019 -0500
+++ b/src/hotspot/share/opto/compile.cpp Tue Jan 22 18:25:56 2019 +0100
@@ -2188,13 +2188,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;
}
}
@@ -2263,7 +2266,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 Jan 22 09:27:19 2019 -0500
+++ b/src/hotspot/share/opto/compile.hpp Tue Jan 22 18:25:56 2019 +0100
@@ -1088,7 +1088,7 @@
void inline_string_calls(bool parse_time);
void inline_boxing_calls(PhaseIterGVN& igvn);
bool optimize_loops(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; }