Do not consider a THEN block ending in an indirect jump for conditional compilation...
authorMichael Meissner <meissner@redhat.com>
Sat, 19 Aug 2000 22:32:11 +0000 (22:32 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Sat, 19 Aug 2000 22:32:11 +0000 (22:32 +0000)
From-SVN: r35812

gcc/ChangeLog
gcc/config/d30v/d30v-protos.h
gcc/config/d30v/d30v.h
gcc/ifcvt.c

index 453be4c4f9f22ccdd23b3555fb5bda07cefecc6d..d17aaf157b8d327bb816a743692140346569f52a 100644 (file)
@@ -1,3 +1,12 @@
+2000-08-19  Michael Meissner  <meissner@redhat.com>
+
+       * ifcvt.c (find_if_block): Do not consider a THEN block that ends
+       in a indirect jump as a potential for conditional execution.
+
+       * d30v.h (d30v_init_expanders): Don't declare here.
+       * d30v-protos.h (d30v_init_expanders): Declare here with a valid
+       prototype.
+
 Sat 19-Aug-2000 21:11:45 BST  Neil Booth  <NeilB@earthling.net>
 
        * cpp.texi: Add @section for assertions.
index 6e774fd7f46296712e78e2db0d422fb5d7a1f2a3..27d1f03efac05d4c1a5e558afa139d12b4b2542c 100644 (file)
@@ -132,6 +132,7 @@ extern void d30v_machine_dependent_reorg PARAMS ((rtx));
 extern int d30v_adjust_cost            PARAMS ((rtx, rtx, rtx, int));
 extern rtx d30v_return_addr            PARAMS ((void));
 #endif
+extern void d30v_init_expanders                PARAMS ((void));
 
 \f
 /* External variables referenced */
index 12f702762098e48bcf45ad0416c9cba26b5e91f6..defdc4969531b2d956b712ac10f940a168885eef 100644 (file)
@@ -1953,7 +1953,7 @@ typedef struct d30v_stack {
    once for every function before code is generated.  */
 
 #define INIT_EXPANDERS  d30v_init_expanders ()
-extern void d30v_init_expanders ();
+
 \f
 /* Stack Checking.  */
 
index 54ad8a73a6f2ffdd285c2ed5abdfe8f9f8645a60..3215f6c3015bf6a60a9a0255668f790f7122a97a 100644 (file)
@@ -1500,11 +1500,23 @@ find_if_block (test_bb, then_edge, else_edge)
 
   /* If the THEN block has no successors, conditional execution can still
      make a conditional call.  Don't do this unless the ELSE block has
-     only one incoming edge -- the CFG manipulation is too ugly otherwise.  */
+     only one incoming edge -- the CFG manipulation is too ugly otherwise.
+     Check for the last insn of the THEN block being an indirect jump, which
+     is listed as not having any successors, but confuses the rest of the CE
+     code processing.  XXX we should fix this in the future.  */
   if (then_succ == NULL)
     {
       if (else_bb->pred->pred_next == NULL_EDGE)
        {
+         rtx last_insn = then_bb->end;
+
+         if (GET_CODE (last_insn) == NOTE)
+           last_insn = prev_nonnote_insn (last_insn);
+
+         if (GET_CODE (last_insn) == JUMP_INSN
+             && ! simplejump_p (last_insn))
+           return FALSE;
+
          join_bb = else_bb;
          else_bb = NULL_BLOCK;
        }