summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-01-26 16:27:34 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-01-26 16:27:34 +0000
commit0d9b0371e86194157b829fbf298e80592fb94d26 (patch)
treea18379b4e501c241ef14523095e2aa75fddf538b
parent7a241624f2a4e684fff1156a8b975801007a425b (diff)
downloadgcc-0d9b0371e86194157b829fbf298e80592fb94d26.tar.gz
re PR tree-optimization/42685 ("-fcompare-debug failure" with "-O1 -funroll-loops" (2))
2010-01-26 Richard Guenther <rguenther@suse.de> 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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/other/pr42685.C10
-rw-r--r--gcc/testsuite/gcc.dg/pr42685.c22
-rw-r--r--gcc/web.c6
5 files changed, 46 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0d292fa17e4..d1e2417b7aa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-26 Richard Guenther <rguenther@suse.de>
+
+ PR rtl-optimization/42685
+ * web.c (web_main): Ignore DEBUG_INSNs.
+
2010-01-26 Joern Rennecke <amylaar@spamcop.net>
* doc/tm.texi (TARGET_HANDLE_C_OPTION): Explain arguments.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0238f4c71f7..79b7546155d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2010-01-26 Richard Guenther <rguenther@suse.de>
+ PR rtl-optimization/42685
+ * gcc.dg/pr42685.c: New testcase.
+ * g++.dg/other/pr42685.C: Likewise.
+
+2010-01-26 Richard Guenther <rguenther@suse.de>
+
PR middle-end/42806
* g++.dg/other/pr42806.C: New testcase.
diff --git a/gcc/testsuite/g++.dg/other/pr42685.C b/gcc/testsuite/g++.dg/other/pr42685.C
new file mode 100644
index 00000000000..b8b1ad63b1b
--- /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 00000000000..29d6381cf5e
--- /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 18579b5cdbd..7e15c2ce4c9 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;