Tue, 15 Apr 2014 14:34:48 -0700
8039050: Crash in C2 compiler at Node::rematerialize
Summary: Added missing calls to record_for_igvn() in loop opts. Added verification of def-use domination.
Reviewed-by: iveresov
1.1 --- a/src/share/vm/opto/loopTransform.cpp Wed Apr 16 18:40:25 2014 -0400 1.2 +++ b/src/share/vm/opto/loopTransform.cpp Tue Apr 15 14:34:48 2014 -0700 1.3 @@ -1147,6 +1147,7 @@ 1.4 // Now force out all loop-invariant dominating tests. The optimizer 1.5 // finds some, but we _know_ they are all useless. 1.6 peeled_dom_test_elim(loop,old_new); 1.7 + loop->record_for_igvn(); 1.8 } 1.9 1.10 //------------------------------is_invariant-----------------------------
2.1 --- a/src/share/vm/opto/loopnode.cpp Wed Apr 16 18:40:25 2014 -0400 2.2 +++ b/src/share/vm/opto/loopnode.cpp Tue Apr 15 14:34:48 2014 -0700 2.3 @@ -3171,17 +3171,16 @@ 2.4 bool had_error = false; 2.5 #ifdef ASSERT 2.6 if (early != C->root()) { 2.7 - // Make sure that there's a dominance path from use to LCA 2.8 - Node* d = use; 2.9 - while (d != LCA) { 2.10 - d = idom(d); 2.11 + // Make sure that there's a dominance path from LCA to early 2.12 + Node* d = LCA; 2.13 + while (d != early) { 2.14 if (d == C->root()) { 2.15 - tty->print_cr("*** Use %d isn't dominated by def %s", use->_idx, n->_idx); 2.16 - n->dump(); 2.17 - use->dump(); 2.18 + dump_bad_graph("Bad graph detected in compute_lca_of_uses", n, early, LCA); 2.19 + tty->print_cr("*** Use %d isn't dominated by def %d ***", use->_idx, n->_idx); 2.20 had_error = true; 2.21 break; 2.22 } 2.23 + d = idom(d); 2.24 } 2.25 } 2.26 #endif 2.27 @@ -3434,6 +3433,13 @@ 2.28 _igvn._worklist.push(n); // Maybe we'll normalize it, if no more loops. 2.29 } 2.30 2.31 +#ifdef ASSERT 2.32 + if (_verify_only && !n->is_CFG()) { 2.33 + // Check def-use domination. 2.34 + compute_lca_of_uses(n, get_ctrl(n), true /* verify */); 2.35 + } 2.36 +#endif 2.37 + 2.38 // CFG and pinned nodes already handled 2.39 if( n->in(0) ) { 2.40 if( n->in(0)->is_top() ) return; // Dead?
3.1 --- a/src/share/vm/opto/loopopts.cpp Wed Apr 16 18:40:25 2014 -0400 3.2 +++ b/src/share/vm/opto/loopopts.cpp Tue Apr 15 14:34:48 2014 -0700 3.3 @@ -2698,6 +2698,7 @@ 3.4 // Inhibit more partial peeling on this loop 3.5 new_head_clone->set_partial_peel_loop(); 3.6 C->set_major_progress(); 3.7 + loop->record_for_igvn(); 3.8 3.9 #if !defined(PRODUCT) 3.10 if (TracePartialPeeling) {