Make sure THEN block has any insns at before testing for indirect jump
authorMichael Meissner <meissner@redhat.com>
Sun, 20 Aug 2000 01:32:44 +0000 (01:32 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Sun, 20 Aug 2000 01:32:44 +0000 (01:32 +0000)
From-SVN: r35813

gcc/ChangeLog
gcc/ifcvt.c

index d17aaf157b8d327bb816a743692140346569f52a..fdf9f56931c1a2c643a8cb75d23b76dfe80aa537 100644 (file)
@@ -1,5 +1,8 @@
 2000-08-19  Michael Meissner  <meissner@redhat.com>
 
+       * ifcvt.c (find_if_block): Do not assume that a THEN block has any
+       instructions in it before checking for indirect jumps.
+
        * ifcvt.c (find_if_block): Do not consider a THEN block that ends
        in a indirect jump as a potential for conditional execution.
 
index 3215f6c3015bf6a60a9a0255668f790f7122a97a..901bd42b483d89dee5c2f9de84bdd5a149b47885 100644 (file)
@@ -1510,10 +1510,13 @@ find_if_block (test_bb, then_edge, else_edge)
        {
          rtx last_insn = then_bb->end;
 
-         if (GET_CODE (last_insn) == NOTE)
-           last_insn = prev_nonnote_insn (last_insn);
+         while (last_insn
+                && GET_CODE (last_insn) == NOTE
+                && last_insn != then_bb->head)
+           last_insn = PREV_INSN (last_insn);
 
-         if (GET_CODE (last_insn) == JUMP_INSN
+         if (last_insn
+             && GET_CODE (last_insn) == JUMP_INSN
              && ! simplejump_p (last_insn))
            return FALSE;