aboutsummaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@redhat.com>2000-08-19 22:32:11 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2000-08-19 22:32:11 +0000
commitf1e42c8110b5089084f9739211b8f303cf884600 (patch)
treec16a7470bdf0c180c60769ef08a4923773b8f3b7 /gcc/ifcvt.c
parent9d6c2770a0999516d86100d90855ac6fd2212df6 (diff)
downloadgcc-f1e42c8110b5089084f9739211b8f303cf884600.zip
gcc-f1e42c8110b5089084f9739211b8f303cf884600.tar.gz
gcc-f1e42c8110b5089084f9739211b8f303cf884600.tar.bz2
Do not consider a THEN block ending in an indirect jump for conditional compilation; Fix d30v warning
From-SVN: r35812
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 54ad8a7..3215f6c 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;
}