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
This commit is contained in:
Alexandre Oliva 2010-12-13 03:08:06 +00:00 committed by Alexandre Oliva
parent 6930a9f664
commit 1132111122
4 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-12-13 Alexandre Oliva <aoliva@redhat.com>
PR debug/46782
* cfgcleanup.c (try_forward_edges): Skip debug insns.
2010-12-12 Jan Hubicka <jh@suse.cz>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

View File

@ -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;

View File

@ -1,3 +1,8 @@
2010-12-13 Alexandre Oliva <aoliva@redhat.com>
PR debug/46782
* gcc.dg/debug/pr46782.c: New.
2010-12-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/46809

View File

@ -0,0 +1,11 @@
/* PR debug/46782 */
/* { dg-do compile } */
/* { dg-options "-w -O0 -fvar-tracking -fcompare-debug" } */
void foo (int i)
{
if (i)
i++;
while (i)
;
}