summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-31 19:33:56 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-31 19:33:56 +0000
commit94858f652572a84eba4a157b695b2524724531e9 (patch)
treee7746b9aad7f941d889dd157949c58c54a052970
parentd8eb7025dbbe13a8bcc63d96f2f7de78739a096a (diff)
downloadgcc-94858f652572a84eba4a157b695b2524724531e9.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116605 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr28839.c18
-rw-r--r--gcc/tree-into-ssa.c7
4 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a6c3e167b9..949adec7367 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2e6cec9e1b4..1a3ecb598ed 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..56a42a37b6e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr28839.c
@@ -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 ();
+}
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 38f338a058b..14a50b62c62 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -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);
}