aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-04-07 21:11:51 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-04-07 21:11:51 +0000
commitcf103ca449e8f5e38f42b107b3271b18c73c59a5 (patch)
tree145e2606d4e9bb3d9ec4665487247f62c68485dd /gcc/function.c
parentdf9292840d1a59a7eee79d70fb38bafabd6049fa (diff)
downloadgcc-cf103ca449e8f5e38f42b107b3271b18c73c59a5.zip
gcc-cf103ca449e8f5e38f42b107b3271b18c73c59a5.tar.gz
gcc-cf103ca449e8f5e38f42b107b3271b18c73c59a5.tar.bz2
basic-block.h (force_nonfallthru): Move to...
* basic-block.h (force_nonfallthru): Move to... * cfghooks.h (struct cfg_hooks): Add force_nonfallthru hook. (force_nonfallthru): ...here. * cfghooks.c (force_nonfallthru): New function. * cfgrtl.c (force_nonfallthru): Rename into... (rtl_force_nonfallthru): ...this. (commit_one_edge_insertion): Do not set AUX field. (commit_edge_insertions): Do not discover new basic blocks. (rtl_cfg_hooks): Add rtl_force_nonfallthru. (cfg_layout_rtl_cfg_hooks): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove bogus ATTRIBUTE_UNUSED. Discover new basic blocks in the prologue insns. * tree-cfg.c (gimple_cfg_hooks): Add NULL for force_nonfallthru. From-SVN: r172128
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 63ecd7c3..14d21c9 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5295,8 +5295,7 @@ thread_prologue_and_epilogue_insns (void)
{
bool inserted;
rtx seq ATTRIBUTE_UNUSED, epilogue_end ATTRIBUTE_UNUSED;
- edge entry_edge ATTRIBUTE_UNUSED;
- edge e;
+ edge entry_edge, e;
edge_iterator ei;
rtl_profile_for_bb (ENTRY_BLOCK_PTR);
@@ -5328,10 +5327,6 @@ thread_prologue_and_epilogue_insns (void)
record_insns (seq, NULL, &prologue_insn_hash);
set_insn_locators (seq, prologue_locator);
- /* This relies on the fact that committing the edge insertion
- will look for basic blocks within the inserted instructions,
- which in turn relies on the fact that we are not in CFG
- layout mode here. */
insert_insn_on_edge (seq, entry_edge);
inserted = true;
#endif
@@ -5566,13 +5561,23 @@ thread_prologue_and_epilogue_insns (void)
cur_bb->aux = cur_bb->next_bb;
cfg_layout_finalize ();
}
+
epilogue_done:
default_rtl_profile ();
if (inserted)
{
+ sbitmap blocks;
+
commit_edge_insertions ();
+ /* Look for basic blocks within the prologue insns. */
+ blocks = sbitmap_alloc (last_basic_block);
+ sbitmap_zero (blocks);
+ SET_BIT (blocks, entry_edge->dest->index);
+ find_many_sub_basic_blocks (blocks);
+ sbitmap_free (blocks);
+
/* The epilogue insns we inserted may cause the exit edge to no longer
be fallthru. */
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)