--- old/src/share/vm/opto/node.cpp	Fri Jun 13 10:36:45 2008
+++ new/src/share/vm/opto/node.cpp	Fri Jun 13 10:36:45 2008
@@ -1073,10 +1073,6 @@
       break;
     }
     Node* up = sub->find_exact_control(sub->in(0));
-    if (up == NULL || up->is_top()) {
-      result = false; // Conservative answer for dead code
-      break;
-    }
     if (sub == up && (sub->is_Loop() || sub->is_Region() && sub->req() != 3)) {
       // Take first valid path on the way up to 'this'.
       up = sub->in(1); // in(LoopNode::EntryControl);
@@ -1140,10 +1136,19 @@
         }
       }
     }
-    if (sub == up) {
+    if (up == sub) {
       result = false;    // some kind of tight cycle
       break;
     }
+    if (up == orig_sub && this_dominates) {
+      // returned back after visiting 'this' node
+      result = false;    // some kind of cycle
+      break;
+    }
+    if (up == NULL || up->is_top()) {
+      result = false; // Conservative answer for dead code
+      break;
+    }
     if (--iterations_without_region_limit < 0) {
       result = false;    // dead cycle
       break;
