summaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-04 18:16:41 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-04 18:16:41 +0000
commitae79515f6cdd36a9619b1a480e544284bb963c32 (patch)
tree14c04ed7180eb69104119cc479397db4833e81aa /gcc/tree-cfg.c
parent1f565f9b9ad2b976899a5d83f7b24e3d7bf6d8d2 (diff)
downloadgcc-ae79515f6cdd36a9619b1a480e544284bb963c32.tar.gz
PR 22037
* tree-cfg.c (replace_uses_by): Call mark_new_vars_to_rename. (tree_merge_blocks): Propagate anything allowed by may_propagate_copy. Clarify documentation. * passes.c (execute_todo): If cleanup_tree_cfg invalidated the SSA form, schedule an update if necessary. testsuite/ChangeLog PR 22037 * g++.dg/tree-ssa/pr22037.C: git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102740 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 096da092151..b5a0696ddec 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1273,7 +1273,7 @@ replace_uses_by (tree name, tree val)
if (TREE_CODE (rhs) == ADDR_EXPR)
recompute_tree_invarant_for_addr_expr (rhs);
- update_stmt (stmt);
+ mark_new_vars_to_rename (stmt);
}
VEC_free (tree, heap, stmts);
@@ -1304,18 +1304,15 @@ tree_merge_blocks (basic_block a, basic_block b)
if (dump_file)
fprintf (dump_file, "Merging blocks %d and %d\n", a->index, b->index);
- /* Remove the phi nodes. */
+ /* Remove all single-valued PHI nodes from block B of the form
+ V_i = PHI <V_j> by propagating V_j to all the uses of V_i. */
bsi = bsi_last (a);
for (phi = phi_nodes (b); phi; phi = phi_nodes (b))
{
tree def = PHI_RESULT (phi), use = PHI_ARG_DEF (phi, 0);
tree copy;
- if (!may_propagate_copy (def, use)
- /* Propagating pointers might cause the set of vops for statements
- to be changed, and thus require ssa form update. */
- || (is_gimple_reg (def)
- && POINTER_TYPE_P (TREE_TYPE (def))))
+ if (!may_propagate_copy (def, use))
{
gcc_assert (is_gimple_reg (def));
@@ -1330,6 +1327,7 @@ tree_merge_blocks (basic_block a, basic_block b)
}
else
replace_uses_by (def, use);
+
remove_phi_node (phi, NULL);
}