diff options
author | Jan Hubicka <jh@suse.cz> | 2005-05-29 00:27:04 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-05-28 22:27:04 +0000 |
commit | fd44f634fde1fee21b4ff2a77173d44184afe33b (patch) | |
tree | 85878c8310af843bb8bfb3a3b2df4ba27bd43cce /gcc/cfgexpand.c | |
parent | 6be8b52474f98eab9b3c490169627b9d1ece43df (diff) | |
download | gcc-fd44f634fde1fee21b4ff2a77173d44184afe33b.zip gcc-fd44f634fde1fee21b4ff2a77173d44184afe33b.tar.gz gcc-fd44f634fde1fee21b4ff2a77173d44184afe33b.tar.bz2 |
re PR tree-optimization/21562 (Quiet bad codegen (unrolling + tail call interaction))
PR tree-optimization/21562
* cfgexpand.c (construct_init_block): Deal properly with the case
of entry edge not pointing to very first basic block.
From-SVN: r100305
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index cd9829e..4e4a8e2 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1157,22 +1157,25 @@ static basic_block construct_init_block (void) { basic_block init_block, first_block; - edge e = NULL, e2; - edge_iterator ei; + edge e = NULL; + int flags; - FOR_EACH_EDGE (e2, ei, ENTRY_BLOCK_PTR->succs) - { - /* Clear EDGE_EXECUTABLE. This flag is never used in the backend. + /* Multiple entry points not supported yet. */ + gcc_assert (EDGE_COUNT (ENTRY_BLOCK_PTR->succs) == 1); - For all other blocks this edge flag is cleared while expanding - a basic block in expand_gimple_basic_block, but there we never - looked at the successors of the entry block. - This caused PR17513. */ - e2->flags &= ~EDGE_EXECUTABLE; + e = EDGE_SUCC (ENTRY_BLOCK_PTR, 0); - if (e2->dest == ENTRY_BLOCK_PTR->next_bb) - e = e2; + /* When entry edge points to first basic block, we don't need jump, + otherwise we have to jump into proper target. */ + if (e && e->dest != ENTRY_BLOCK_PTR->next_bb) + { + tree label = tree_block_label (e->dest); + + emit_jump (label_rtx (label)); + flags = 0; } + else + flags = EDGE_FALLTHRU; init_block = create_basic_block (NEXT_INSN (get_insns ()), get_last_insn (), @@ -1183,7 +1186,7 @@ construct_init_block (void) { first_block = e->dest; redirect_edge_succ (e, init_block); - e = make_edge (init_block, first_block, EDGE_FALLTHRU); + e = make_edge (init_block, first_block, flags); } else e = make_edge (init_block, EXIT_BLOCK_PTR, EDGE_FALLTHRU); |