summaryrefslogtreecommitdiff
path: root/gcc/cfganal.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-11 17:16:28 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-11 17:16:28 +0000
commit4c69d9cb565c4553cd36c9463cb514dfe85f8ab1 (patch)
treefa9e11cf8b568b8afe5c8d0febfdf02da5bbb8e9 /gcc/cfganal.c
parentedd2f2aec757fc4e8c1bae048a0735785eeb6443 (diff)
downloadgcc-4c69d9cb565c4553cd36c9463cb514dfe85f8ab1.tar.gz
* i386.md (testsi to testqi spliters): New.
2002-01-14 Josef Zlomek <zlomek@matfyz.cz> cfg.c (dump_edge_info): added dumping of EDGE_CAN_FALLTHRU. Wed Jan 9 2002 Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz> * basic-block.h: New flag EDGE_CAN_FALLTHRU * cfganal.c (set_edge_can_fallthru_flag): New function; marks the edges that can be made fallthru. Mon Nov 12 16:25:53 CET 2001 Jan Hubicka <jh@suse.cz> * cfglayout.c (cleanup_unconditional_jumps): New static function. (cfg_layout_initialize): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53383 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r--gcc/cfganal.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index f70c6c7b2fc..a64124cfb79 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -189,6 +189,36 @@ mark_dfs_back_edges ()
return found;
}
+/* Set the flag EDGE_CAN_FALLTHRU for edges that can be fallthru. */
+
+void
+set_edge_can_fallthru_flag ()
+{
+ int i;
+ for (i = 0; i < n_basic_blocks; i++)
+ {
+ basic_block bb = BASIC_BLOCK (i);
+ edge e;
+
+ /* The FALLTHRU edge is also CAN_FALLTHRU edge. */
+ for (e = bb->succ; e; e = e->succ_next)
+ if (e->flags & EDGE_FALLTHRU)
+ e->flags |= EDGE_CAN_FALLTHRU;
+
+ /* If the BB ends with an invertable condjump all (2) edges are
+ CAN_FALLTHRU edges. */
+ if (!bb->succ || !bb->succ->succ_next || bb->succ->succ_next->succ_next)
+ continue;
+ if (!any_condjump_p (bb->end))
+ continue;
+ if (!invert_jump (bb->end, JUMP_LABEL (bb->end), 0))
+ continue;
+ invert_jump (bb->end, JUMP_LABEL (bb->end), 0);
+ bb->succ->flags |= EDGE_CAN_FALLTHRU;
+ bb->succ->succ_next->flags |= EDGE_CAN_FALLTHRU;
+ }
+}
+
/* Return true if we need to add fake edge to exit.
Helper function for the flow_call_edges_add. */
@@ -326,9 +356,12 @@ flow_call_edges_add (blocks)
/* Note that the following may create a new basic block
and renumber the existing basic blocks. */
- e = split_block (bb, split_at_insn);
- if (e)
- blocks_split++;
+ if (split_at_insn != bb->end)
+ {
+ e = split_block (bb, split_at_insn);
+ if (e)
+ blocks_split++;
+ }
make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE);
}