From 34c9e8480c6a0ace2477e48179650e615adee3a1 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Sun, 20 Aug 2000 01:32:44 +0000 Subject: [PATCH] Make sure THEN block has any insns at before testing for indirect jump From-SVN: r35813 --- gcc/ChangeLog | 3 +++ gcc/ifcvt.c | 9 ++++++--- 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 + * 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;