summaryrefslogtreecommitdiff
path: root/gcc/tree-phinodes.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-09 19:13:07 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-09 19:13:07 +0000
commita8046f6028a5b566796bea8409ceea78b0c9c5f2 (patch)
tree43d76704cc977318946377c4bb267eca1f611d0e /gcc/tree-phinodes.c
parentd7ecac2ed2227fc3db9e50e13aab98bf92bd0e26 (diff)
downloadgcc-a8046f6028a5b566796bea8409ceea78b0c9c5f2.tar.gz
* Makefile.in (OBJC-common): Add tree-ssa-threadupdate.c
(tree-ssa-threadupdate.o): Add dependencies. * tree-ssa-threadupdate.c: New file. * tree-flow.h (incoming_edge_threaded): New flag in block annotation. (rewrite_vars_out_of_ssa): Remove prototype. (cleanup_tree_cfg): Returns a bool. * tree.h (thread_through_all_blocks): Prototype. * tree-outof-ssa.c (SSANORM_*): Move into here. (remove_ssa_form): Now static. (rewrite_vars_out_of_ssa): Kill. * tree-ssa-live.c (register_ssa_partitions_for_vars): Kill. * tree-ssa-live.h (SSANORM_*): Moved into tree-outof-ssa.c. (remove_ssa_form, register_partitions_for_vars): Kill declarations. * tree-cfg.c (cleanup_tree_cfg): Return a value indicating if anything was changed. * tree-phinodes.c (add_phi_arg): Get the block for the PHI from the PHI's annotation rather than the edge associated with the new argument. * tree-ssa-dom.c (redirection_edges): Kill. (redirect_edges_and_update_ssa_graph): Kill. (tree_ssa_dominator_optimize): Do not reset forwardable flag for blocks anymore. Do not initialize redirection_edges. Call thread_through_all_blocks. Simplify code for cleanup of the CFG and iterating. No longer call cleanup_tree_cfg outside the iteration loop. (thread_across_edge): No longer mess with forwardable blocks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85721 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-phinodes.c')
-rw-r--r--gcc/tree-phinodes.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index 3b54b08a40d..5bf77360601 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -335,17 +335,24 @@ add_phi_arg (tree *phi, tree def, edge e)
release the old PHI node. */
if (*phi != old_phi)
{
+ /* Extract the basic block for the PHI from the PHI's annotation
+ rather than the edge. This works better as the edge's
+ destination may not currently be the block with the PHI
+ node if we are in the process of threading the edge to
+ a new destination. */
+ basic_block bb = bb_for_stmt (*phi);
+
release_phi_node (old_phi);
/* Update the list head if replacing the first listed phi. */
- if (phi_nodes (e->dest) == old_phi)
- bb_ann (e->dest)->phi_nodes = *phi;
+ if (phi_nodes (bb) == old_phi)
+ bb_ann (bb)->phi_nodes = *phi;
else
{
/* Traverse the list looking for the phi node to chain to. */
tree p;
- for (p = phi_nodes (e->dest);
+ for (p = phi_nodes (bb);
p && PHI_CHAIN (p) != old_phi;
p = PHI_CHAIN (p))
;