This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

alpha ifcvt crash


Bad things happen when you try to merge EXIT with something else.  ;-)


r~


        * ifcvt.c (find_if_case_2): Don't allow THEN to be EXIT.

Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ifcvt.c,v
retrieving revision 1.16
diff -u -p -d -r1.16 ifcvt.c
--- ifcvt.c	2000/05/16 06:21:04	1.16
+++ ifcvt.c	2000/05/19 20:04:44
@@ -1652,14 +1652,17 @@ find_if_case_2 (test_bb, then_edge, else
   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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]