From b3e4665562a83f85a5d590d137ae042854c035a8 Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Thu, 3 Dec 2015 15:46:57 +0000 Subject: [PATCH] Empty the redirect_edge_var_map after each pass Alan Lawrence Richard Biener * cfgexpand.c (pass_expand::execute): Replace call to redirect_edge_var_map_destroy with redirect_edge_var_map_empty. * tree-ssa.c (delete_tree_ssa): Likewise. * function.c (set_cfun): Call redirect_edge_var_map_empty. * passes.c (execute_one_ipa_transform_pass, execute_one_pass): Likewise. * tree-ssa.h (redirect_edge_var_map_destroy): Remove. (redirect_edge_var_map_empty): New. * tree-ssa.c (redirect_edge_var_map_destroy): Remove. (redirect_edge_var_map_empty): New. Co-Authored-By: Richard Biener From-SVN: r231232 --- gcc/ChangeLog | 13 +++++++++++++ gcc/cfgexpand.c | 2 +- gcc/function.c | 2 ++ gcc/passes.c | 2 ++ gcc/tree-ssa.c | 8 ++++---- gcc/tree-ssa.h | 2 +- 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5fe3c1c0da6..de8ae8a40c9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2015-12-03 Alan Lawrence + Richard Biener + + * cfgexpand.c (pass_expand::execute): Replace call to + redirect_edge_var_map_destroy with redirect_edge_var_map_empty. + * tree-ssa.c (delete_tree_ssa): Likewise. + * function.c (set_cfun): Call redirect_edge_var_map_empty. + * passes.c (execute_one_ipa_transform_pass, execute_one_pass): Likewise. + * tree-ssa.h (redirect_edge_var_map_destroy): Remove. + (redirect_edge_var_map_empty): New. + * tree-ssa.c (redirect_edge_var_map_destroy): Remove. + (redirect_edge_var_map_empty): New. + 2015-12-03 Jeff Law PR tree-optimization/68599 diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 2c3b23d6244..0cf417270e9 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -6294,7 +6294,7 @@ pass_expand::execute (function *fun) expand_phi_nodes (&SA); /* Release any stale SSA redirection data. */ - redirect_edge_var_map_destroy (); + redirect_edge_var_map_empty (); /* Register rtl specific functions for cfg. */ rtl_register_cfg_hooks (); diff --git a/gcc/function.c b/gcc/function.c index 515d7c04220..e4528655917 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -75,6 +75,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-chkp.h" #include "rtl-chkp.h" #include "tree-dfa.h" +#include "tree-ssa.h" /* So we can assign to cfun in this file. */ #undef cfun @@ -4798,6 +4799,7 @@ set_cfun (struct function *new_cfun) { cfun = new_cfun; invoke_set_current_function_hook (new_cfun ? new_cfun->decl : NULL_TREE); + redirect_edge_var_map_empty (); } } diff --git a/gcc/passes.c b/gcc/passes.c index 0e23dcbec78..ba9bfc276b1 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -2218,6 +2218,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node, pass_fini_dump_file (pass); current_pass = NULL; + redirect_edge_var_map_empty (); /* Signal this is a suitable GC collection point. */ if (!(todo_after & TODO_do_not_ggc_collect)) @@ -2370,6 +2371,7 @@ execute_one_pass (opt_pass *pass) || pass->type != RTL_PASS); current_pass = NULL; + redirect_edge_var_map_empty (); if (todo_after & TODO_discard_function) { diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 02fca4c8e67..ddc7a657cbd 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -119,10 +119,10 @@ redirect_edge_var_map_vector (edge e) /* Clear the edge variable mappings. */ void -redirect_edge_var_map_destroy (void) +redirect_edge_var_map_empty (void) { - delete edge_var_maps; - edge_var_maps = NULL; + if (edge_var_maps) + edge_var_maps->empty (); } @@ -1128,7 +1128,7 @@ delete_tree_ssa (struct function *fn) fn->gimple_df = NULL; /* We no longer need the edge variable maps. */ - redirect_edge_var_map_destroy (); + redirect_edge_var_map_empty (); } /* Return true if EXPR is a useless type conversion, otherwise return diff --git a/gcc/tree-ssa.h b/gcc/tree-ssa.h index 3b5bd706593..d33eb9c82fe 100644 --- a/gcc/tree-ssa.h +++ b/gcc/tree-ssa.h @@ -35,7 +35,7 @@ extern void redirect_edge_var_map_add (edge, tree, tree, source_location); extern void redirect_edge_var_map_clear (edge); extern void redirect_edge_var_map_dup (edge, edge); extern vec *redirect_edge_var_map_vector (edge); -extern void redirect_edge_var_map_destroy (void); +extern void redirect_edge_var_map_empty (void); extern edge ssa_redirect_edge (edge, basic_block); extern void flush_pending_stmts (edge); extern void gimple_replace_ssa_lhs (gimple *, tree); -- 2.30.2