* tree-cfg.c (tree_execute_on_shrinking_pred): New.
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Nov 2004 22:06:16 +0000 (22:06 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Nov 2004 22:06:16 +0000 (22:06 +0000)
(tree_cfg_hooks): Use it.
* tree-ssa.c (ssa_remove_edge): Don't call remove_phi_args.
(ssa_redirect_edge): Don't call remove_phi_arg_num.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91036 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-cfg.c
gcc/tree-ssa.c

index c023f37..440e813 100644 (file)
        (cfg_layout_rtl_cfg_hook): Likewise.
        * tree-cfg.c (tree_cfg_hooks): Likewise.
 
+       * tree-cfg.c (tree_execute_on_shrinking_pred): New.
+       (tree_cfg_hooks): Use it.
+       * tree-ssa.c (ssa_remove_edge): Don't call remove_phi_args.
+       (ssa_redirect_edge): Don't call remove_phi_arg_num.
+
 2004-11-23  Ben Elliston  <bje@au.ibm.com>
 
        * doc/cfg.texi (Maintaining the CFG): Use @ftable instead of
index f00084a..b7097eb 100644 (file)
@@ -5339,6 +5339,16 @@ tree_purge_all_dead_eh_edges (bitmap blocks)
   return changed;
 }
 
+/* This function is called immediately before edge E is removed from
+   the edge vector E->dest->preds.  */
+
+static void
+tree_execute_on_shrinking_pred (edge e)
+{
+  if (phi_nodes (e->dest))
+    remove_phi_args (e);
+}
+
 struct cfg_hooks tree_cfg_hooks = {
   "tree",
   tree_verify_flow_info,
@@ -5362,7 +5372,7 @@ struct cfg_hooks tree_cfg_hooks = {
   tree_block_ends_with_condjump_p, /* block_ends_with_condjump_p */
   tree_flow_call_edges_add,     /* flow_call_edges_add */
   NULL,        /* execute_on_growing_pred */
-  NULL, /* execute_on_shrinking_pred */
+  tree_execute_on_shrinking_pred, /* execute_on_shrinking_pred */
 };
 
 
index 1e2b59d..14a8b90 100644 (file)
@@ -53,9 +53,6 @@ Boston, MA 02111-1307, USA.  */
 void
 ssa_remove_edge (edge e)
 {
-  /* Remove all PHI arguments for E.  */
-  remove_phi_args (e);
-
   remove_edge (e);
 }
 
@@ -85,8 +82,6 @@ ssa_redirect_edge (edge e, basic_block dest)
       node = build_tree_list (dst, src);
       *last = node;
       last = &TREE_CHAIN (node);
-
-      remove_phi_arg_num (phi, i);
     }
 
   e = redirect_edge_succ_nodup (e, dest);