tree-sra.c (sra_walk_function): Don't rely on aliases being build.
authorJan Hubicka <jh@suse.cz>
Sat, 27 Jan 2007 22:31:19 +0000 (23:31 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 27 Jan 2007 22:31:19 +0000 (22:31 +0000)
* tree-sra.c (sra_walk_function): Don't rely on aliases being build.
(pass_sra): Do not require alias information.
* passes.c (init_optimization_passes): Add SRA

From-SVN: r121240

gcc/ChangeLog
gcc/passes.c
gcc/tree-sra.c

index 99fcc33ed8c469c19c55dae9d82ae1f037a863a0..c8befd262c4b9570600e0d8207dae25caca37bc5 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-27  Jan Hubicka  <jh@suse.cz>
+
+       * tree-sra.c (sra_walk_function): Don't rely on aliases being build.
+       (pass_sra): Do not require alias information.
+       * passes.c (init_optimization_passes): Add SRA
+
 2007-01-27  Steven Bosscher  <steven@gcc.gnu.org>
 
        * tracer.c (rest_of_handle_tracer): We already cleaned
index 5333beace15f710f1a52b4f9dd68223db3e9de46..f1a702efaaa8fb641be6c47bb57c4dd4db26d567 100644 (file)
@@ -496,6 +496,7 @@ init_optimization_passes (void)
   NEXT_PASS (pass_ccp);
   
   NEXT_PASS (pass_forwprop);
+  NEXT_PASS (pass_sra);
   NEXT_PASS (pass_copy_prop);
   NEXT_PASS (pass_merge_phi);
   NEXT_PASS (pass_dce);
index da338fc28fd8ea34d7e9a09379d14e1b9cd48f04..a2d28cac2c42516dc8b23f4f7d556ce6514f6400 100644 (file)
@@ -973,8 +973,9 @@ sra_walk_function (const struct sra_walk_fns *fns)
 
        /* If the statement has no virtual operands, then it doesn't
           make any structure references that we care about.  */
-       if (ZERO_SSA_OPERANDS (stmt, (SSA_OP_VIRTUAL_DEFS | SSA_OP_VUSE)))
-         continue;
+       if (gimple_aliases_computed_p (cfun)
+           && ZERO_SSA_OPERANDS (stmt, (SSA_OP_VIRTUAL_DEFS | SSA_OP_VUSE)))
+             continue;
 
        switch (TREE_CODE (stmt))
          {
@@ -989,7 +990,9 @@ sra_walk_function (const struct sra_walk_fns *fns)
               as a USE of the variable on the RHS of this assignment.  */
 
            t = TREE_OPERAND (stmt, 0);
-           if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
+           if (t == NULL_TREE)
+             ;
+           else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
              sra_walk_expr (&GIMPLE_STMT_OPERAND (t, 1), &si, false, fns);
            else
              sra_walk_expr (&TREE_OPERAND (stmt, 0), &si, false, fns);
@@ -2374,7 +2377,7 @@ struct tree_opt_pass pass_sra =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_SRA,                         /* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
+  PROP_cfg | PROP_ssa,                 /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */