diff options
author | Jan Hubicka <jh@suse.cz> | 2002-05-11 19:16:28 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2002-05-11 17:16:28 +0000 |
commit | 6c81a49011d7d197a0b291531f109cca4ed298a8 (patch) | |
tree | fa9e11cf8b568b8afe5c8d0febfdf02da5bbb8e9 /gcc/cfganal.c | |
parent | a5c76ee6e2c613ac4c3e309e562d51bea137c73a (diff) | |
download | gcc-6c81a49011d7d197a0b291531f109cca4ed298a8.tar.gz |
i386.md (testsi to testqi spliters): New.
* 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.
Co-Authored-By: Pavel Nejedly <bim@atrey.karlin.mff.cuni.cz>
From-SVN: r53383
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r-- | gcc/cfganal.c | 39 |
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); } |