]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/42685 ("-fcompare-debug failure" with "-O1 -funroll-loops...
authorRichard Guenther <rguenther@suse.de>
Tue, 26 Jan 2010 16:27:34 +0000 (16:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 26 Jan 2010 16:27:34 +0000 (16:27 +0000)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr42685.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr42685.c [new file with mode: 0644]
gcc/web.c

index 0d292fa17e46f9beb044ef5cf7f41e4e3189e928..d1e2417b7aa6790a51937a8df41252f5ffed8e2e 100644 (file)
@@ -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.
index 0238f4c71f79f27e6b483fd1bfde02da4fbad400..79b7546155d43687f596c9ced7a3778a89658061 100644 (file)
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/testsuite/g++.dg/other/pr42685.C b/gcc/testsuite/g++.dg/other/pr42685.C
new file mode 100644 (file)
index 0000000..b8b1ad6
--- /dev/null
@@ -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 (file)
index 0000000..29d6381
--- /dev/null
@@ -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);
+}
index 18579b5cdbd2ce5948b41b14a295ee1d40753cc2..7e15c2ce4c94bd0dd72fdd874aa10866f7e4b4f1 100644 (file)
--- 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;