aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2010-12-13 03:08:06 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2010-12-13 03:08:06 +0000
commit11321111221bd6f8ce17c254452132a6fbd5abd7 (patch)
tree9003b88e1c055be42fd5dbdcc718b461c42629c0 /gcc/cfgcleanup.c
parent6930a9f664805681ba354af8378cef2ed9d661a1 (diff)
downloadgcc-11321111221bd6f8ce17c254452132a6fbd5abd7.zip
gcc-11321111221bd6f8ce17c254452132a6fbd5abd7.tar.gz
gcc-11321111221bd6f8ce17c254452132a6fbd5abd7.tar.bz2
re PR debug/46782 (-fcompare-debug failure (length) with -fvar-tracking)
gcc/ChangeLog: PR debug/46782 * cfgcleanup.c (try_forward_edges): Skip debug insns. gcc/testsuite/ChangeLog: PR debug/46782 * gcc.dg/debug/pr46782.c: New. From-SVN: r167737
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index c365b5e..78635d2 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -487,11 +487,17 @@ try_forward_edges (int mode, basic_block b)
new_target = NULL;
else
{
+ rtx last;
+
if (new_locus)
locus = new_locus;
- new_locus = INSN_P (BB_END (target))
- ? INSN_LOCATOR (BB_END (target)) : 0;
+ last = BB_END (target);
+ if (DEBUG_INSN_P (last))
+ last = prev_nondebug_insn (last);
+
+ new_locus = last && INSN_P (last)
+ ? INSN_LOCATOR (last) : 0;
if (new_locus && locus && !locator_eq (new_locus, locus))
new_target = NULL;