hotspot/src/share/vm/opto/gcm.cpp
changeset 781 e1baa9c8f16f
parent 670 ddf3e9583f2f
parent 761 312de898447e
child 1070 e03de091796e
--- a/hotspot/src/share/vm/opto/gcm.cpp	Thu Jul 03 11:01:32 2008 -0700
+++ b/hotspot/src/share/vm/opto/gcm.cpp	Fri Jul 11 01:14:44 2008 -0700
@@ -307,7 +307,6 @@
 
     // Test and set the visited bit.
     if (mid->raise_LCA_visited() == mark)  continue;  // already visited
-    mid->set_raise_LCA_visited(mark);
 
     // Don't process the current LCA, otherwise the search may terminate early
     if (mid != LCA && mid->raise_LCA_mark() == mark) {
@@ -317,6 +316,8 @@
       assert(early->dominates(LCA), "early is high enough");
       // Resume searching at that point, skipping intermediate levels.
       worklist.push(LCA);
+      if (LCA == mid)
+        continue; // Don't mark as visited to avoid early termination.
     } else {
       // Keep searching through this block's predecessors.
       for (uint j = 1, jmax = mid->num_preds(); j < jmax; j++) {
@@ -324,6 +325,7 @@
         worklist.push(mid_parent);
       }
     }
+    mid->set_raise_LCA_visited(mark);
   }
   return LCA;
 }