------- Comment #2 from jakub at gcc dot gnu dot org 2007-11-27 12:31 ------- Testcase in C: /* 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); } As perfect_nestify will call mark_syms_for_renaming, I believe the right fix is to update todo flags of this pass either using: --- tree-ssa-loop.c.jj6 2007-09-17 22:25:50.000000000 +0200 +++ 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 */ }; or by returning TODO_update_ssa_only_virtuals from tree_linear_transform if there wasn't already a perfect nest. As update_ssa is a nop if !need_ssa_update_p, I believe just adding | TODO_update_ssa_only_virtuals to pass_linear_transform.todo_flags_finish is better. Will test. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34016