aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-10-09 22:04:10 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-10-09 22:04:10 +0200
commit1692ae7eda60ea567bcd8e8bae40b6f20db5d82a (patch)
tree0169af2955472328d5f862f7396b198dfc82b215 /gcc/cfgrtl.c
parente81897731e2232b88f735bf8b8ce319d76983b51 (diff)
downloadgcc-1692ae7eda60ea567bcd8e8bae40b6f20db5d82a.zip
gcc-1692ae7eda60ea567bcd8e8bae40b6f20db5d82a.tar.gz
gcc-1692ae7eda60ea567bcd8e8bae40b6f20db5d82a.tar.bz2
rtl.h (locator_eq): New decl.
* rtl.h (locator_eq): New decl. * cfglayout.c (locator_scope): New function. (insn_scope): Use it. (locator_eq): New function. (fixup_reorder_chain): Search for last insn in src bb that has locator set or first insn in dest bb. Use locator_eq instead of == to compare locators. * cfgrtl.c (cfg_layout_merge_blocks): Likewise. * cfgcleanup.c (try_forward_edges): Use locator_eq instead of == to compare locators. From-SVN: r141009
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 24469eb..a7dc507 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -2615,19 +2615,21 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
some unique locus, emit a nop with that locus in between. */
if (!optimize && EDGE_SUCC (a, 0)->goto_locus)
{
- rtx insn = BB_END (a);
+ rtx insn = BB_END (a), end = PREV_INSN (BB_HEAD (a));
int goto_locus = EDGE_SUCC (a, 0)->goto_locus;
- if (NOTE_P (insn))
- insn = prev_nonnote_insn (insn);
- if (insn && INSN_P (insn) && INSN_LOCATOR (insn) == goto_locus)
+ while (insn != end && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0))
+ insn = PREV_INSN (insn);
+ if (insn != end && locator_eq (INSN_LOCATOR (insn), goto_locus))
goto_locus = 0;
else
{
insn = BB_HEAD (b);
- if (!INSN_P (insn))
- insn = next_insn (insn);
- if (insn && INSN_P (insn) && INSN_LOCATOR (insn) == goto_locus)
+ end = NEXT_INSN (BB_END (b));
+ while (insn != end && !INSN_P (insn))
+ insn = NEXT_INSN (insn);
+ if (insn != end && INSN_LOCATOR (insn) != 0
+ && locator_eq (INSN_LOCATOR (insn), goto_locus))
goto_locus = 0;
}
if (goto_locus)