re PR middle-end/24049 (compiler error: Segmentation fault In function 'DESX_CBCUpdate')
authorRichard Henderson <rth@redhat.com>
Thu, 6 Oct 2005 08:41:47 +0000 (01:41 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 6 Oct 2005 08:41:47 +0000 (01:41 -0700)
        PR 24049
        * passes.c (init_optimization_passes): Move pass_lower_vector_ssa
        under pass_vectorize.  Clear TODO_ggc_collect from the dce pass
        under pass_vectorize.

From-SVN: r105029

gcc/ChangeLog
gcc/passes.c
gcc/testsuite/gcc.dg/vect/pr24049.c [new file with mode: 0644]

index 1ef72bc8c99d78adfc81d713284bca3b6f917164..30d4affd0136abded21739ebd887bfd15cdce525 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-06  Richard Henderson  <rth@redhat.com>
+
+       PR 24049
+       * passes.c (init_optimization_passes): Move pass_lower_vector_ssa
+       under pass_vectorize.  Clear TODO_ggc_collect from the dce pass
+       under pass_vectorize.
+
 2005-10-05  Devang Patel  <dpatel@apple.com>
 
        PR Debug/23205
index b03eae39f4398033943c2baebb4cf7053c545432..daa752e541d6133839eb45ccc1ce265626224e4e 100644 (file)
@@ -588,14 +588,19 @@ init_optimization_passes (void)
   /* NEXT_PASS (pass_may_alias) cannot be done again because the
      vectorizer creates alias relations that are not supported by
      pass_may_alias.  */
-  NEXT_PASS (pass_lower_vector_ssa);
   NEXT_PASS (pass_complete_unroll);
   NEXT_PASS (pass_iv_optimize);
   NEXT_PASS (pass_tree_loop_done);
   *p = NULL;
 
   p = &pass_vectorize.sub;
+  NEXT_PASS (pass_lower_vector_ssa);
+  /* ??? The loop optimizers are not GC safe.  See PR 21805.
+     Turn off GC while registering this pass.  */
+  pass_dce.todo_flags_finish &= ~TODO_ggc_collect;
   NEXT_PASS (pass_dce);
+  pass_dce.todo_flags_finish |= TODO_ggc_collect;
+  gcc_assert (p != &pass_dce.next);
   *p = NULL;
 
   p = &pass_loop2.sub;
diff --git a/gcc/testsuite/gcc.dg/vect/pr24049.c b/gcc/testsuite/gcc.dg/vect/pr24049.c
new file mode 100644 (file)
index 0000000..ee03fe3
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize --param ggc-min-heapsize=0 --param ggc-min-expand=0" } */
+
+int DES_CBCUpdate(unsigned char * output, int len)
+{
+  int work[2];
+  unsigned int i;
+  for(i = 0;i < len/8;i++)
+    unscrunch (&output[8*i], work);
+}