* ifcvt.c (find_if_case_2): Don't allow THEN to be EXIT.
authorRichard Henderson <rth@cygnus.com>
Fri, 19 May 2000 20:07:18 +0000 (13:07 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 19 May 2000 20:07:18 +0000 (13:07 -0700)
From-SVN: r34036

gcc/ChangeLog
gcc/ifcvt.c

index c8c6c95a681edc69ebc62c9145b09cb58a70d6d9..5e4fc881432dbbc2ab02baa788d01f58122d2221 100644 (file)
@@ -1,5 +1,7 @@
 2000-05-19  Richard Henderson  <rth@cygnus.com>
 
+       * ifcvt.c (find_if_case_2): Don't allow THEN to be EXIT.
+
        * flow.c (make_edges): The sibling call edge to exit is abnormal.
 
 2000-05-19  Richard Henderson  <rth@cygnus.com>
index 24036513b655b0a8f6471146e48fa23b16c21319..371e5609353a7d04c411c5087a483f99af17c292 100644 (file)
@@ -1652,14 +1652,17 @@ find_if_case_2 (test_bb, then_edge, else_edge)
   if (else_bb->pred->pred_next != NULL)
     return FALSE;
 
+  /* THEN is not EXIT.  */
+  if (then_bb->index < 0)
+    return FALSE;
+
   /* ELSE is predicted or SUCC(ELSE) postdominates THEN.  */
   note = find_reg_note (test_bb->end, REG_BR_PROB, NULL_RTX);
   if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2)
     ;
   else if (else_succ->dest->index < 0
-          || (then_bb->index >= 0
-              && TEST_BIT (post_dominators[ORIG_INDEX (then_bb)], 
-                           ORIG_INDEX (else_succ->dest))))
+          || TEST_BIT (post_dominators[ORIG_INDEX (then_bb)], 
+                       ORIG_INDEX (else_succ->dest)))
     ;
   else
     return FALSE;