8217230: assert(t == t_no_spec) failure in NodeHash::check_no_speculative_types()

Remove dead node from C2 IR.

Reviewed-by: roland, neliasso
This commit is contained in:
Tobias Hartmann 2019-01-22 18:25:56 +01:00
parent c9bea6a8ea
commit 930c19bcc2
2 changed files with 6 additions and 3 deletions

View file

@ -2188,13 +2188,16 @@ bool Compile::optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode) {
// They were inserted during parsing (see add_safepoint()) to make // They were inserted during parsing (see add_safepoint()) to make
// infinite loops without calls or exceptions visible to root, i.e., // infinite loops without calls or exceptions visible to root, i.e.,
// useful. // useful.
void Compile::remove_root_to_sfpts_edges() { void Compile::remove_root_to_sfpts_edges(PhaseIterGVN& igvn) {
Node *r = root(); Node *r = root();
if (r != NULL) { if (r != NULL) {
for (uint i = r->req(); i < r->len(); ++i) { for (uint i = r->req(); i < r->len(); ++i) {
Node *n = r->in(i); Node *n = r->in(i);
if (n != NULL && n->is_SafePoint()) { if (n != NULL && n->is_SafePoint()) {
r->rm_prec(i); r->rm_prec(i);
if (n->outcnt() == 0) {
igvn.remove_dead_node(n);
}
--i; --i;
} }
} }
@ -2263,7 +2266,7 @@ void Compile::Optimize() {
// Now that all inlining is over, cut edge from root to loop // Now that all inlining is over, cut edge from root to loop
// safepoints // safepoints
remove_root_to_sfpts_edges(); remove_root_to_sfpts_edges(igvn);
// Remove the speculative part of types and clean up the graph from // Remove the speculative part of types and clean up the graph from
// the extra CastPP nodes whose only purpose is to carry them. Do // the extra CastPP nodes whose only purpose is to carry them. Do

View file

@ -1088,7 +1088,7 @@ class Compile : public Phase {
void inline_string_calls(bool parse_time); void inline_string_calls(bool parse_time);
void inline_boxing_calls(PhaseIterGVN& igvn); void inline_boxing_calls(PhaseIterGVN& igvn);
bool optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode); 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 // Matching, CFG layout, allocation, code generation
PhaseCFG* cfg() { return _cfg; } PhaseCFG* cfg() { return _cfg; }