re PR debug/46771 (-fcompare-debug failure (length) with -O -ftree-vectorize)
authorJakub Jelinek <jakub@redhat.com>
Mon, 6 Dec 2010 19:29:38 +0000 (20:29 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 6 Dec 2010 19:29:38 +0000 (20:29 +0100)
PR debug/46771
* reginfo.c (init_subregs_of_mode): Don't call find_subregs_of_mode
on DEBUG_INSNs.

* gcc.dg/pr46771.c: New test.

From-SVN: r167514

gcc/ChangeLog
gcc/reginfo.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr46771.c [new file with mode: 0644]

index 047bcef..7412c20 100644 (file)
@@ -1,5 +1,9 @@
 2010-12-06  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/46771
+       * reginfo.c (init_subregs_of_mode): Don't call find_subregs_of_mode
+       on DEBUG_INSNs.
+
        PR rtl-optimization/46777
        * cfglayout.c (duplicate_insn_chain): Avoid duplicating
        also barrier after tablejump.
index aaf062e..7c1209f 100644 (file)
@@ -1330,7 +1330,7 @@ init_subregs_of_mode (void)
 
   FOR_EACH_BB (bb)
     FOR_BB_INSNS (bb, insn)
-    if (INSN_P (insn))
+    if (NONDEBUG_INSN_P (insn))
       find_subregs_of_mode (PATTERN (insn));
 }
 
index 3c5c43e..f64afd4 100644 (file)
@@ -1,5 +1,8 @@
 2010-12-06  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/46771
+       * gcc.dg/pr46771.c: New test.
+
        PR rtl-optimization/46777
        * gcc.dg/pr46777.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr46771.c b/gcc/testsuite/gcc.dg/pr46771.c
new file mode 100644 (file)
index 0000000..b44dfd4
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR debug/46771 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -fcompare-debug" } */
+
+unsigned char v[1600];
+
+unsigned char
+foo (unsigned char x)
+{
+  int i;
+  unsigned char a = x;
+  unsigned char b = x;
+  for (i = 0; i < 1600; i++)
+    a = a < v[i] ? v[i] : a;
+  for (i = 0; i < 1600; i++)
+    b = b > v[i] ? v[i] : b;
+  return a - b;
+}