summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/ifcvt.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d17aaf157b8..fdf9f56931c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 3215f6c3015..901bd42b483 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -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;