diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2013-11-13 22:55:49 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2013-11-13 22:55:49 +0000 |
commit | d7b6661b5518178c86b947a5996afbd468ee69a6 (patch) | |
tree | c0544da5ab78cc2a30727ef7c2fc441c94407305 /gcc/cfgrtl.c | |
parent | c3d77f3add93300df9893709111089f2a9650e83 (diff) | |
download | gcc-d7b6661b5518178c86b947a5996afbd468ee69a6.zip gcc-d7b6661b5518178c86b947a5996afbd468ee69a6.tar.gz gcc-d7b6661b5518178c86b947a5996afbd468ee69a6.tar.bz2 |
cfgrtl.c (can_fallthru): Reorder code to move tablejump check up.
* cfgrtl.c (can_fallthru): Reorder code to move tablejump check up.
Make that check explicit. BB_HEAD cannot be NULL, remove check for it.
* haifa-sched.c (ready_remove_first_dispatch): Check INSN_P before
looking at INSN_CODE.
* reload1.c (delete_dead_insn) Do not expect JUMP_TABLE_DATA to be an
active_insn_p object, respect basic block boundaries.
* reorg.c (follow_jumps): Use invariant that JUMP_TABLE_DATA always
follows immediately after the jump table data label.
* config/nds32/nds32.c (nds32_output_casesi_pc_relative): Likewise.
* config/sh/sh.c (barrier_align): Likewise. Rearrange code such
that JUMP_TABLE_DATA is not expected to be an active_insn_p object.
From-SVN: r204758
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index d6733a2..c7ee7ee 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -610,7 +610,7 @@ forwarder_block_p (const_basic_block bb) } /* Return nonzero if we can reach target from src by falling through. */ -/* FIXME: Make this a cfg hook. */ +/* FIXME: Make this a cfg hook, the result is only valid in cfgrtl mode. */ bool can_fallthru (basic_block src, basic_block target) @@ -623,17 +623,21 @@ can_fallthru (basic_block src, basic_block target) if (target == EXIT_BLOCK_PTR) return true; if (src->next_bb != target) - return 0; + return false; + + /* ??? Later we may add code to move jump tables offline. */ + if (tablejump_p (insn, NULL, NULL)) + return false; + FOR_EACH_EDGE (e, ei, src->succs) if (e->dest == EXIT_BLOCK_PTR && e->flags & EDGE_FALLTHRU) - return 0; + return false; insn2 = BB_HEAD (target); - if (insn2 && !active_insn_p (insn2)) + if (!active_insn_p (insn2)) insn2 = next_active_insn (insn2); - /* ??? Later we may add code to move jump tables offline. */ return next_active_insn (insn) == insn2; } |