hotspot/src/share/vm/opto/ifnode.cpp
changeset 958 4c4709e8b7ee
parent 190 e9a0a9dcd4f6
child 1217 5eb97f366a6a
--- a/hotspot/src/share/vm/opto/ifnode.cpp	Fri Jul 25 09:07:29 2008 -0700
+++ b/hotspot/src/share/vm/opto/ifnode.cpp	Fri Jul 25 11:32:56 2008 -0700
@@ -725,6 +725,11 @@
   int true_path = phi->is_diamond_phi();
   if( true_path == 0 ) return NULL;
 
+  // Make sure that iff and the control of the phi are different. This
+  // should really only happen for dead control flow since it requires
+  // an illegal cycle.
+  if (phi->in(0)->in(1)->in(0) == iff) return NULL;
+
   // phi->region->if_proj->ifnode->bool->cmp
   BoolNode *bol2 = phi->in(0)->in(1)->in(0)->in(1)->as_Bool();
 
@@ -751,6 +756,7 @@
   }
 
   Node* new_bol = (flip ? phase->transform( bol2->negate(phase) ) : bol2);
+  assert(new_bol != iff->in(1), "must make progress");
   iff->set_req(1, new_bol);
   // Intervening diamond probably goes dead
   phase->C->set_major_progress();