From: Richard Guenther Date: Tue, 26 Jan 2010 16:27:34 +0000 (+0000) Subject: re PR tree-optimization/42685 ("-fcompare-debug failure" with "-O1 -funroll-loops... X-Git-Tag: releases/gcc-4.5.0~1047 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d9b0371e86194157b829fbf298e80592fb94d26;p=thirdparty%2Fgcc.git re PR tree-optimization/42685 ("-fcompare-debug failure" with "-O1 -funroll-loops" (2)) 2010-01-26 Richard Guenther PR rtl-optimization/42685 * web.c (web_main): Ignore DEBUG_INSNs. * gcc.dg/pr42685.c: New testcase. * g++.dg/other/pr42685.C: Likewise. From-SVN: r156252 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d292fa17e46..d1e2417b7aa6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-01-26 Richard Guenther + + PR rtl-optimization/42685 + * web.c (web_main): Ignore DEBUG_INSNs. + 2010-01-26 Joern Rennecke * doc/tm.texi (TARGET_HANDLE_C_OPTION): Explain arguments. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0238f4c71f79..79b7546155d4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-01-26 Richard Guenther + + PR rtl-optimization/42685 + * gcc.dg/pr42685.c: New testcase. + * g++.dg/other/pr42685.C: Likewise. + 2010-01-26 Richard Guenther PR middle-end/42806 diff --git a/gcc/testsuite/g++.dg/other/pr42685.C b/gcc/testsuite/g++.dg/other/pr42685.C new file mode 100644 index 000000000000..b8b1ad63b1b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr42685.C @@ -0,0 +1,10 @@ +// { dg-do compile } +// { dg-options "-O -funroll-loops -fcompare-debug" } + +void Remap(int n, int *src, int *dst, int *map) +{ + do { + int i = *src; + if (i != 0) *dst = map[i]; + } while (--n != 0); +} diff --git a/gcc/testsuite/gcc.dg/pr42685.c b/gcc/testsuite/gcc.dg/pr42685.c new file mode 100644 index 000000000000..29d6381cf5ee --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr42685.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O -funroll-loops -fcompare-debug" } */ + +struct S { + int i; +}; + +extern void baz(int); + +static inline void bar(struct S *s) +{ + baz(s->i); +} + +void foo(int *w, int cond, struct S *s) +{ + int i, n = 0; + while (*w++ != 0) n++; + for (i = 0; i < n; i++) + if (cond == 0) + bar(s + i); +} diff --git a/gcc/web.c b/gcc/web.c index 18579b5cdbd2..7e15c2ce4c94 100644 --- a/gcc/web.c +++ b/gcc/web.c @@ -298,7 +298,7 @@ web_main (void) FOR_BB_INSNS (bb, insn) { unsigned int uid = INSN_UID (insn); - if (INSN_P (insn)) + if (NONDEBUG_INSN_P (insn)) { df_ref *use_rec; for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++) @@ -326,7 +326,7 @@ web_main (void) FOR_BB_INSNS (bb, insn) { unsigned int uid = INSN_UID (insn); - if (INSN_P (insn)) + if (NONDEBUG_INSN_P (insn)) { df_ref *use_rec; for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++) @@ -350,7 +350,7 @@ web_main (void) FOR_BB_INSNS (bb, insn) { unsigned int uid = INSN_UID (insn); - if (INSN_P (insn)) + if (NONDEBUG_INSN_P (insn)) { df_ref *use_rec; df_ref *def_rec;