summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-19 22:32:11 +0000
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-19 22:32:11 +0000
commitd86c820b243c32c68928292dbf1c5f7af63d7d9e (patch)
treec16a7470bdf0c180c60769ef08a4923773b8f3b7 /gcc/ifcvt.c
parenta238f1ddc6e2aed9ec6251dcd2cd81d2ee2aee0c (diff)
downloadgcc-d86c820b243c32c68928292dbf1c5f7af63d7d9e.tar.gz
Do not consider a THEN block ending in an indirect jump for conditional compilation; Fix d30v warning
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35812 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 54ad8a73a6f..3215f6c3015 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -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;
}