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]

[PATCH] Add TODO_update_ssa_only_virtuals to pass_linear_transform.todo_flags_finish (PR tree-optimization/34016)


Hi!

If gcc_loopnest_to_lambda_loopnest needs to convert at least one
of the non-perfect loop nests using perfect_nestify, it calls
mark_sym_for_renaming:
                  /* If the statement has any virtual operands, they may
                     need to be rewired because the original loop may
                     still reference them.  */
                  FOR_EACH_SSA_TREE_OPERAND (n, stmt, i, SSA_OP_ALL_VIRTUALS)
                    mark_sym_for_renaming (SSA_NAME_VAR (n));
but pass_linear_transform todo_flags_finish flags don't say
a SSA update might be needed, so gcc hits an assert.
The following patch fixes that, bootstrapped/regtested on x86_64-linux.

Ok for trunk?

2007-11-27  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/34016
	* tree-ssa-loop.c (pass_linear_transform): Add
	TODO_update_ssa_only_virtuals to todo_flags_finish.

	* gcc.dg/pr34016.c: New test.

--- gcc/tree-ssa-loop.c.jj	2007-09-17 22:25:50.000000000 +0200
+++ gcc/tree-ssa-loop.c	2007-11-27 13:18:41.000000000 +0100
@@ -272,6 +272,7 @@ struct tree_opt_pass pass_linear_transfo
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
   TODO_dump_func | TODO_verify_loops
+    | TODO_update_ssa_only_virtuals
     | TODO_ggc_collect,			/* todo_flags_finish */
   0				        /* letter */	
 };
--- gcc/testsuite/gcc.dg/pr34016.c.jj	2007-11-27 13:42:39.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr34016.c	2007-11-27 13:24:14.000000000 +0100
@@ -0,0 +1,19 @@
+/* PR tree-optimization/34016 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern void bar (double *);
+
+void foo (void)
+{
+  double gr[36];
+  int i, j;
+  for (i = 0; i <= 5; i++)
+    {
+      for (j = 0; j <= 5; j++)
+	gr[i + j * 6] = 0.0;
+      if (i <= 2)
+	gr[i + i * 6] = 1.0;
+    }
+  bar (gr);
+}

	Jakub


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