re PR tree-optimization/28839 (ICE in tree-vectorizer.c with -O2 -ftree-vectorize...
authorZdenek Dvorak <dvorakz@suse.cz>
Thu, 31 Aug 2006 19:33:56 +0000 (21:33 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Thu, 31 Aug 2006 19:33:56 +0000 (19:33 +0000)
PR tree-optimization/28839
* tree-into-ssa.c (prune_unused_phi_nodes): Take into account kills in
blocks in that phi arguments appear.

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

From-SVN: r116605

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr28839.c [new file with mode: 0644]
gcc/tree-into-ssa.c

index 7a6c3e1..949adec 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-31  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR tree-optimization/28839
+       * tree-into-ssa.c (prune_unused_phi_nodes): Take into account kills in
+       blocks in that phi arguments appear.
+
 2006-08-31  Roger Sayle  <roger@eyesopen.com>
 
        PR other/22313
index 2e6cec9..1a3ecb5 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-31  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR tree-optimization/28839
+       * gcc.dg/pr28839.c: New test.
+
 2006-08-31  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        PR target/24367
diff --git a/gcc/testsuite/gcc.dg/pr28839.c b/gcc/testsuite/gcc.dg/pr28839.c
new file mode 100644 (file)
index 0000000..56a42a3
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -msse2 -ftree-vectorize -funswitch-loops" } */
+
+static int ready[10];
+void abort (void);
+void test_once (int t,int t1)
+{
+  int i, repeat;
+  for (i = 0; i < 10; i++)
+    {
+      ready[i] = 0;
+      if (t1)
+       if (b())
+         abort ();
+    }
+  if (t)
+    abort ();
+}
index 38f338a..14a50b6 100644 (file)
@@ -977,6 +977,13 @@ prune_unused_phi_nodes (bitmap phis, bitmap kills, bitmap uses)
          if (bitmap_bit_p (uses, u))
            continue;
 
+         /* In case there is a kill directly in the use block, do not record
+            the use (this is also necessary for correctness, as we assume that
+            uses dominated by a def directly in their block have been filtered
+            out before).  */
+         if (bitmap_bit_p (kills, u))
+           continue;
+
          bitmap_set_bit (uses, u);
          VEC_safe_push (int, heap, worklist, u);
        }