diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-10-21 21:38:03 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-10-21 21:38:03 +0000 |
commit | 50a36e4261f5cf4170a6f679bad0d62608bdeba3 (patch) | |
tree | 10c3922c8385f847f20a9ba8405c363043095228 /gcc/cfgrtl.c | |
parent | 233a46c83456d0be35fd0e0ef826c8d87d97c3cc (diff) | |
download | gcc-50a36e4261f5cf4170a6f679bad0d62608bdeba3.zip gcc-50a36e4261f5cf4170a6f679bad0d62608bdeba3.tar.gz gcc-50a36e4261f5cf4170a6f679bad0d62608bdeba3.tar.bz2 |
cfgcleanup.c (try_forward_edges): Do not throw away previous steps when stopping because of a different locus on...
* cfgcleanup.c (try_forward_edges): Do not throw away previous steps
when stopping because of a different locus on edge or insn.
(try_optimize_cfg): Add comment.
* cfgrtl.c (rtl_merge_blocks): Tweak log message. If the destination
block is a forwarder block, propagate locus on the edge.
(cfg_layout_merge_blocks): Likewise.
From-SVN: r165789
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index a158112..a19ba8d 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -588,10 +588,12 @@ rtl_merge_blocks (basic_block a, basic_block b) rtx b_head = BB_HEAD (b), b_end = BB_END (b), a_end = BB_END (a); rtx del_first = NULL_RTX, del_last = NULL_RTX; rtx b_debug_start = b_end, b_debug_end = b_end; + bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0; int b_empty = 0; if (dump_file) - fprintf (dump_file, "merging block %d into block %d\n", b->index, a->index); + fprintf (dump_file, "Merging block %d into block %d...\n", b->index, + a->index); while (DEBUG_INSN_P (b_end)) b_end = PREV_INSN (b_debug_start = b_end); @@ -680,6 +682,13 @@ rtl_merge_blocks (basic_block a, basic_block b) df_bb_delete (b->index); BB_END (a) = a_end; + + /* If B was a forwarder block, propagate the locus on the edge. */ + if (forwarder_p && !EDGE_SUCC (b, 0)->goto_locus) + EDGE_SUCC (b, 0)->goto_locus = EDGE_SUCC (a, 0)->goto_locus; + + if (dump_file) + fprintf (dump_file, "Merged blocks %d and %d.\n", a->index, b->index); } @@ -2692,10 +2701,13 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b) static void cfg_layout_merge_blocks (basic_block a, basic_block b) { + bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0; + gcc_checking_assert (cfg_layout_can_merge_blocks_p (a, b)); if (dump_file) - fprintf (dump_file, "merging block %d into block %d\n", b->index, a->index); + fprintf (dump_file, "Merging block %d into block %d...\n", b->index, + a->index); /* If there was a CODE_LABEL beginning B, delete it. */ if (LABEL_P (BB_HEAD (b))) @@ -2803,9 +2815,12 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) b->il.rtl->footer = NULL; } + /* If B was a forwarder block, propagate the locus on the edge. */ + if (forwarder_p && !EDGE_SUCC (b, 0)->goto_locus) + EDGE_SUCC (b, 0)->goto_locus = EDGE_SUCC (a, 0)->goto_locus; + if (dump_file) - fprintf (dump_file, "Merged blocks %d and %d.\n", - a->index, b->index); + fprintf (dump_file, "Merged blocks %d and %d.\n", a->index, b->index); } /* Split edge E. */ |