From a8046f6028a5b566796bea8409ceea78b0c9c5f2 Mon Sep 17 00:00:00 2001 From: law Date: Mon, 9 Aug 2004 19:13:07 +0000 Subject: * 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 --- gcc/tree-phinodes.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/tree-phinodes.c') 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)) ; -- cgit v1.2.1