summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictork <victork@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-07 11:28:31 +0000
committervictork <victork@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-07 11:28:31 +0000
commit0bf7f84736d44a77940785b2014ea9d8edaba578 (patch)
tree2a815da8cd510d65ff313810b7ecb7deddfa81f0
parent899164c59f66740a114ca2b08731e03003005023 (diff)
downloadppe42-gcc-0bf7f84736d44a77940785b2014ea9d8edaba578.tar.gz
ppe42-gcc-0bf7f84736d44a77940785b2014ea9d8edaba578.zip
ChangeLog
PR tree-optimization/26969 * tree-vect-analyze.c (vect_analyze_loop_form): Add check of latch witch an empty list of PHIs. testsuite/Changelog: PR tree-optimizations/26969 * gcc.dg/vect/vect.exp: Compile tests prefixed with "unswitch-loops" with -funswitch-loops. * gcc.dg/vect/unswitch-loops-pr26969.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115995 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c15
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect.exp6
-rw-r--r--gcc/tree-vect-analyze.c3
5 files changed, 34 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cf04b9473d2..c147849fd69 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,8 @@
-2006-08-06 Andreas Schwab <schwab@suse.de>
+2006-08-07 Victor Kaplansky <victork@il.ibm.com>
- * config/m68k/m68k.md (truncxfsf2): Readd.
+ PR tree-optimization/26969
+ * tree-vect-analyze.c (vect_analyze_loop_form): Add check of latch
+ with an empty list of PHIs.
2006-08-06 Paolo Bonzini <bonzini@gnu.org>
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d563b73e3c9..8fdda6be9d6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-08-07 Victor Kaplansky <victork@il.ibm.com>
+
+ PR tree-optimizations/26969
+ * gcc.dg/vect/vect.exp: Compile tests prefixed with
+ "unswitch-loops" with -funswitch-loops.
+ * gcc.dg/vect/unswitch-loops-pr26969.c: New test.
+
2006-08-07 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/sparc-getcontext-1.c: Fix typo.
diff --git a/gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c b/gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c
new file mode 100644
index 00000000000..b92a7fb7cb6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void
+ruby_re_compile_fastmap (char *fastmap, int options)
+{
+ int j;
+ for (j = 0; j < (1 << 8); j++)
+ {
+ if (j != '\n' || (options & 4))
+ fastmap[j] = 1;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp
index 007aa203f7d..001c97ad61d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -133,6 +133,12 @@ lappend DEFAULT_VECTCFLAGS "-fno-section-anchors"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-section-anchors-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
+# -funswitch-loops tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-funswitch-loops"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/unswitch-loops-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
# With -Os
lappend DEFAULT_VECTCFLAGS "-Os"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 9df8ba26606..f247cd9ab31 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -1889,7 +1889,8 @@ vect_analyze_loop_form (struct loop *loop)
that the loop is represented as a do-while (with a proper if-guard
before the loop if needed), where the loop header contains all the
executable statements, and the latch is empty. */
- if (!empty_block_p (loop->latch))
+ if (!empty_block_p (loop->latch)
+ || phi_nodes (loop->latch))
{
if (vect_print_dump_info (REPORT_BAD_FORM_LOOPS))
fprintf (vect_dump, "not vectorized: unexpected loop form.");
OpenPOWER on IntegriCloud