]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/26969 (ICE with -O1 -funswitch-loops -ftree-vectorize)
authorVictor Kaplansky <victork@il.ibm.com>
Mon, 7 Aug 2006 11:28:31 +0000 (11:28 +0000)
committerVictor Kaplansky <victork@gcc.gnu.org>
Mon, 7 Aug 2006 11:28:31 +0000 (11:28 +0000)
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.

From-SVN: r115995

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect.exp
gcc/tree-vect-analyze.c

index cf04b9473d2598aa2b614b04e196dc2356c6e0b2..c147849fd6915d8780d53f5c456d7da20541e0e6 100644 (file)
@@ -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>
 
index d563b73e3c9611a9aed22550e81850fa094fb12c..8fdda6be9d61f4dee24071ec168bdc676c564b8d 100644 (file)
@@ -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 (file)
index 0000000..b92a7fb
--- /dev/null
@@ -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" } } */
index 007aa203f7d576e7670345eaa61a6aa0f21ca075..001c97ad61d29044a2c87f9a321c9dadfba718c6 100644 (file)
@@ -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\]]]  \
index 9df8ba26606d7ffbf25eb24a1341f7240cf7df10..f247cd9ab31f39dcbb46545250fbdd8b8c2d395c 100644 (file)
@@ -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.");