This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix 24049


As noted in the pr, and those other prs linked to it, scev is
unsafe with gc so we can't run it.  I'm not terribly pleased
with the hackery to get rid of TODO_ggc_collect, but I'm not
happy with having to turn off garbage collection either.


r~


        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.

Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.115
diff -u -p -r2.115 passes.c
--- passes.c	27 Sep 2005 18:47:27 -0000	2.115
+++ passes.c	6 Oct 2005 08:38:13 -0000
@@ -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;
Index: testsuite/gcc.dg/vect/pr24049.c
===================================================================
RCS file: testsuite/gcc.dg/vect/pr24049.c
diff -N testsuite/gcc.dg/vect/pr24049.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gcc.dg/vect/pr24049.c	6 Oct 2005 08:39:40 -0000
@@ -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);
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]