]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-into-ssa.c (mark_def_sites): Also process virtual operands.
authorRichard Guenther <rguenther@suse.de>
Mon, 30 Jul 2012 11:18:15 +0000 (11:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 30 Jul 2012 11:18:15 +0000 (11:18 +0000)
2012-07-30  Richard Guenther  <rguenther@suse.de>

* tree-into-ssa.c (mark_def_sites): Also process virtual operands.
(rewrite_stmt): Likewise.
(rewrite_enter_block): Likewise.
(pass_build_ssa): Do not update virtual SSA form during TODO.
(mark_symbol_for_renaming): Do nothing if we are not in SSA form.
* lto-streamer-in.c (lto_read_body): Set in_ssa_p earlier.

* gcc.dg/ipa/ipa-pta-3.c: Adjust.
* gcc.dg/ipa/ipa-pta-4.c: Likewise.
* gcc.dg/tm/memopt-3.c: Likewise.

From-SVN: r189969

gcc/ChangeLog
gcc/lto-streamer-in.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c
gcc/testsuite/gcc.dg/tm/memopt-3.c
gcc/tree-into-ssa.c

index 1db4fa04a214e7b988864541902c2dbef93c58db..2b445f8cc9ef764714336fb61ec19affe54a2f71 100644 (file)
@@ -1,3 +1,12 @@
+2012-07-30  Richard Guenther  <rguenther@suse.de>
+
+       * tree-into-ssa.c (mark_def_sites): Also process virtual operands.
+       (rewrite_stmt): Likewise.
+       (rewrite_enter_block): Likewise.
+       (pass_build_ssa): Do not update virtual SSA form during TODO.
+       (mark_symbol_for_renaming): Do nothing if we are not in SSA form.
+       * lto-streamer-in.c (lto_read_body): Set in_ssa_p earlier.
+
 2012-07-30  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/39423
index b9893a17b1da32c4ae05db03f240a164e4b98a59..d497eef5a55a49b5e26abc873bf7cb1f2cd4bdb9 100644 (file)
@@ -979,6 +979,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
       push_cfun (fn);
       init_tree_ssa (fn);
 
+      /* We input IL in SSA form.  */
+      cfun->gimple_df->in_ssa_p = true;
+
       /* Use the function's decl state. */
       decl_state = lto_get_function_in_decl_state (file_data, fn_decl);
       gcc_assert (decl_state);
@@ -1015,9 +1018,6 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
            }
        }
 
-      /* We should now be in SSA.  */
-      cfun->gimple_df->in_ssa_p = true;
-
       /* Restore decl state */
       file_data->current_decl_state = file_data->global_decl_state;
 
index ce9393cb0724f545151518f9786ce68c5b79c836..47900809b9fc0ec6e4117829f84aa8165c48d8b4 100644 (file)
@@ -23,6 +23,6 @@ int main()
 
 /* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
 /* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
-/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre2" } } */
+/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
 /* { dg-final { cleanup-tree-dump "fre2" } } */
 /* { dg-final { cleanup-ipa-dump "pta" } } */
index 32e1e4fbc4911826538b0ae181b39174cb1d7dd7..bf6fa281d5a865efefb9cb0a4f24554274d97925 100644 (file)
@@ -28,6 +28,6 @@ int main()
 
 /* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
 /* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
-/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre2" } } */
+/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
 /* { dg-final { cleanup-tree-dump "fre2" } } */
 /* { dg-final { cleanup-ipa-dump "pta" } } */
index 77337161c2c7e3ab693ef6f68ae1759ab0b6d549..1220ffc4a0bfd77c908f03f482e5fd8d99f834a4 100644 (file)
@@ -16,5 +16,5 @@ int f()
   return lala.x[0];
 }
 
-/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_1\\\]" 1 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_4\\\]" 1 "tmmark" } } */
 /* { dg-final { cleanup-tree-dump "tmmark" } } */
index bc70642cdc9d9c0618e518e02f30c91a22f289a9..ea433ed5dc4d50488b20ed64e8b415c79c84ba4f 100644 (file)
@@ -675,7 +675,7 @@ mark_def_sites (basic_block bb, gimple stmt, bitmap kills)
 
   /* If a variable is used before being set, then the variable is live
      across a block boundary, so mark it live-on-entry to BB.  */
-  FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
+  FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
     {
       tree sym = USE_FROM_PTR (use_p);
       gcc_assert (DECL_P (sym));
@@ -686,7 +686,7 @@ mark_def_sites (basic_block bb, gimple stmt, bitmap kills)
 
   /* Now process the defs.  Mark BB as the definition block and add
      each def to the set of killed symbols.  */
-  FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
+  FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
     {
       gcc_assert (DECL_P (def));
       set_def_block (def, bb, false);
@@ -1336,7 +1336,7 @@ rewrite_stmt (gimple_stmt_iterator si)
       if (is_gimple_debug (stmt))
        rewrite_debug_stmt_uses (stmt);
       else
-       FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
+       FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
          {
            tree var = USE_FROM_PTR (use_p);
            gcc_assert (DECL_P (var));
@@ -1346,7 +1346,7 @@ rewrite_stmt (gimple_stmt_iterator si)
 
   /* Step 2.  Register the statement's DEF operands.  */
   if (register_defs_p (stmt))
-    FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_DEF)
+    FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
       {
        tree var = DEF_FROM_PTR (def_p);
        tree name = make_ssa_name (var, stmt);
@@ -1404,7 +1404,6 @@ static void
 rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
                     basic_block bb)
 {
-  gimple phi;
   gimple_stmt_iterator gsi;
 
   if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1418,11 +1417,7 @@ rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
      node introduces a new version for the associated variable.  */
   for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
     {
-      tree result;
-
-      phi = gsi_stmt (gsi);
-      result = gimple_phi_result (phi);
-      gcc_assert (is_gimple_reg (result));
+      tree result = gimple_phi_result (gsi_stmt (gsi));
       register_new_def (result, SSA_NAME_VAR (result));
     }
 
@@ -2437,8 +2432,7 @@ struct gimple_opt_pass pass_build_ssa =
   PROP_ssa,                            /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_update_ssa_only_virtuals
-    | TODO_verify_ssa
+  TODO_verify_ssa
     | TODO_remove_unused_locals                /* todo_flags_finish */
  }
 };
@@ -2889,7 +2883,8 @@ register_new_name_mapping (tree new_tree, tree old)
 void
 mark_sym_for_renaming (tree sym)
 {
-  bitmap_set_bit (SYMS_TO_RENAME (cfun), DECL_UID (sym));
+  if (cfun->gimple_df->in_ssa_p)
+    bitmap_set_bit (SYMS_TO_RENAME (cfun), DECL_UID (sym));
 }