re PR debug/46561 (-fcompare-debug failure (length) with -O2 -ftree-vectorize -ftree...
authorJakub Jelinek <jakub@redhat.com>
Sat, 20 Nov 2010 12:14:48 +0000 (13:14 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 20 Nov 2010 12:14:48 +0000 (13:14 +0100)
PR debug/46561
* tree-parloops.c (try_create_redunction_list): Ignore debug stmts
when looking for immediate uses.

* gcc.dg/autopar/pr46561.c: New test.

From-SVN: r166975

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/autopar/pr46561.c [new file with mode: 0644]
gcc/tree-parloops.c

index b5dbd5b..758f7ae 100644 (file)
@@ -1,5 +1,9 @@
 2010-11-20  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/46561
+       * tree-parloops.c (try_create_redunction_list): Ignore debug stmts
+       when looking for immediate uses.
+
        PR tree-optimization/45830
        * stmt.c (expand_switch_using_bit_tests_p): New function.
        (expand_case): Use it.
index 9a00252..6d32aa6 100644 (file)
@@ -1,5 +1,8 @@
 2010-11-20  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/46561
+       * gcc.dg/autopar/pr46561.c: New test.
+
        PR c++/46538
        * g++.dg/other/error34.C: New test.
 
diff --git a/gcc/testsuite/gcc.dg/autopar/pr46561.c b/gcc/testsuite/gcc.dg/autopar/pr46561.c
new file mode 100644 (file)
index 0000000..a9499f3
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR debug/46561 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -ftree-parallelize-loops=2 -fcompare-debug" } */
+
+extern void abort (void);
+
+void foo (char *c)
+{
+  int i;
+  unsigned x = 0;
+  {
+    for (i = 0; i < 64; i += 4)
+       x = x | *((unsigned *) (&c[i]));
+    if (x)
+      abort ();
+  }
+}
index a634b24..a0d1688 100644 (file)
@@ -1870,7 +1870,8 @@ try_create_reduction_list (loop_p loop, htab_t reduction_list)
          reduc_phi = NULL;
          FOR_EACH_IMM_USE_FAST (use_p, imm_iter, val)
            {
-             if (flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
+             if (!gimple_debug_bind_p (USE_STMT (use_p))
+                 && flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
                {
                  reduc_phi = USE_STMT (use_p);
                  break;