diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-21 21:38:03 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-21 21:38:03 +0000 |
commit | 18b762f059f7f2de9eadfe2dfbecf01bd52b3949 (patch) | |
tree | 10c3922c8385f847f20a9ba8405c363043095228 /gcc/cfgcleanup.c | |
parent | c61e2d0b793158ba2f2c644aa5c57e358226a9d3 (diff) | |
download | gcc-18b762f059f7f2de9eadfe2dfbecf01bd52b3949.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 9563e3f5567..881a4f34d18 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -485,22 +485,28 @@ try_forward_edges (int mode, basic_block b) { /* When not optimizing, ensure that edges or forwarder blocks with different locus are not optimized out. */ - int locus = single_succ_edge (target)->goto_locus; + int new_locus = single_succ_edge (target)->goto_locus; + int locus = goto_locus; - if (locus && goto_locus && !locator_eq (locus, goto_locus)) - counter = n_basic_blocks; - else if (locus) - goto_locus = locus; - - if (INSN_P (BB_END (target))) + if (new_locus && locus && !locator_eq (new_locus, locus)) + new_target = NULL; + else { - locus = INSN_LOCATOR (BB_END (target)); + if (new_locus) + locus = new_locus; - if (locus && goto_locus - && !locator_eq (locus, goto_locus)) - counter = n_basic_blocks; - else if (locus) - goto_locus = locus; + new_locus = INSN_P (BB_END (target)) + ? INSN_LOCATOR (BB_END (target)) : 0; + + if (new_locus && locus && !locator_eq (new_locus, locus)) + new_target = NULL; + else + { + if (new_locus) + locus = new_locus; + + goto_locus = locus; + } } } } @@ -2379,6 +2385,7 @@ try_optimize_cfg (int mode) continue; } + /* Merge B with its single successor, if any. */ if (single_succ_p (b) && (s = single_succ_edge (b)) && !(s->flags & EDGE_COMPLEX) |