From 11321111221bd6f8ce17c254452132a6fbd5abd7 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 13 Dec 2010 03:08:06 +0000 Subject: 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 --- gcc/cfgcleanup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gcc/cfgcleanup.c') 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; -- cgit v1.1