changeset 5107:3a2cedafb805

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: kvn
author sgabdura
date Fri, 18 Apr 2014 08:11:07 +0200
parents cfea5eeb3a76
children 4cf0cf96701d
files src/share/vm/opto/loopTransform.cpp src/share/vm/opto/loopnode.cpp src/share/vm/opto/loopopts.cpp
diffstat 3 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/loopTransform.cpp	Fri Apr 18 08:08:05 2014 +0200
+++ b/src/share/vm/opto/loopTransform.cpp	Fri Apr 18 08:11:07 2014 +0200
@@ -1127,6 +1127,7 @@
   // Now force out all loop-invariant dominating tests.  The optimizer
   // finds some, but we _know_ they are all useless.
   peeled_dom_test_elim(loop,old_new);
+  loop->record_for_igvn();
 }
 
 //------------------------------is_invariant-----------------------------
--- a/src/share/vm/opto/loopnode.cpp	Fri Apr 18 08:08:05 2014 +0200
+++ b/src/share/vm/opto/loopnode.cpp	Fri Apr 18 08:11:07 2014 +0200
@@ -3171,17 +3171,16 @@
   bool had_error = false;
 #ifdef ASSERT
   if (early != C->root()) {
-    // Make sure that there's a dominance path from use to LCA
-    Node* d = use;
-    while (d != LCA) {
-      d = idom(d);
+    // Make sure that there's a dominance path from LCA to early
+    Node* d = LCA;
+    while (d != early) {
       if (d == C->root()) {
-        tty->print_cr("*** Use %d isn't dominated by def %s", use->_idx, n->_idx);
-        n->dump();
-        use->dump();
+        dump_bad_graph("Bad graph detected in compute_lca_of_uses", n, early, LCA);
+        tty->print_cr("*** Use %d isn't dominated by def %d ***", use->_idx, n->_idx);
         had_error = true;
         break;
       }
+      d = idom(d);
     }
   }
 #endif
@@ -3434,6 +3433,13 @@
     _igvn._worklist.push(n);  // Maybe we'll normalize it, if no more loops.
   }
 
+#ifdef ASSERT
+  if (_verify_only && !n->is_CFG()) {
+    // Check def-use domination.
+    compute_lca_of_uses(n, get_ctrl(n), true /* verify */);
+  }
+#endif
+
   // CFG and pinned nodes already handled
   if( n->in(0) ) {
     if( n->in(0)->is_top() ) return; // Dead?
--- a/src/share/vm/opto/loopopts.cpp	Fri Apr 18 08:08:05 2014 +0200
+++ b/src/share/vm/opto/loopopts.cpp	Fri Apr 18 08:11:07 2014 +0200
@@ -2684,6 +2684,7 @@
   // Inhibit more partial peeling on this loop
   new_head_clone->set_partial_peel_loop();
   C->set_major_progress();
+  loop->record_for_igvn();
 
 #if !defined(PRODUCT)
   if (TracePartialPeeling) {