summaryrefslogtreecommitdiff
path: root/gcc/tree-optimize.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-27 23:33:02 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-27 23:33:02 +0000
commit8218c244f48a1616aa9380ff915b9bee10243393 (patch)
tree52ebb42ae3f07c4bfcb29a8a669cb78feed3a95c /gcc/tree-optimize.c
parentbc5f266a5e18a1501f2ec65a355395edfe2f272e (diff)
downloadgcc-8218c244f48a1616aa9380ff915b9bee10243393.tar.gz
* tree-optimize.c (exercute_free_datastructures):
Do not disband implicit edges; do not attempt to build insn list; do not free cfg annotations. (execute_free_cfg_annotations); Disband implicit edges here; free cfg annotations here too. (pass_free_cfg_annotations); New pass. (init_tree_optimization_passes); Add pass_free_cfg_annotations. * tree-ssa-operands.c (free_ssa_operands); Recover; export. * tree-ssa-operands.h (free_ssa_operands); declare. * tree-ssa.c (delete_tree_ssa); Free SSA operand; mark stmt modified; kill PHI nodes. * tree-ssanames.c (release_defs): Kill addresses_taken. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101360 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r--gcc/tree-optimize.c51
1 files changed, 40 insertions, 11 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 4b46c9b7ec5..24db18684f3 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -120,32 +120,61 @@ static struct tree_opt_pass pass_cleanup_cfg_post_optimizing =
static void
execute_free_datastructures (void)
{
- tree *chain;
-
/* ??? This isn't the right place for this. Worse, it got computed
more or less at random in various passes. */
free_dominance_info (CDI_DOMINATORS);
-
- /* Emit gotos for implicit jumps. */
- disband_implicit_edges ();
+ free_dominance_info (CDI_POST_DOMINATORS);
/* Remove the ssa structures. Do it here since this includes statement
annotations that need to be intact during disband_implicit_edges. */
delete_tree_ssa ();
+}
+
+static struct tree_opt_pass pass_free_datastructures =
+{
+ NULL, /* name */
+ NULL, /* gate */
+ execute_free_datastructures, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ 0, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+ 0 /* letter */
+};
+/* Pass: free cfg annotations. */
+
+static void
+execute_free_cfg_annotations (void)
+{
+ basic_block bb;
+ block_stmt_iterator bsi;
- /* Re-chain the statements from the blocks. */
- chain = &DECL_SAVED_TREE (current_function_decl);
- *chain = alloc_stmt_list ();
+ /* Emit gotos for implicit jumps. */
+ disband_implicit_edges ();
+
+ /* Remove annotations from every tree in the function. */
+ FOR_EACH_BB (bb)
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ {
+ tree stmt = bsi_stmt (bsi);
+ ggc_free (stmt->common.ann);
+ stmt->common.ann = NULL;
+ }
/* And get rid of annotations we no longer need. */
delete_tree_cfg_annotations ();
}
-static struct tree_opt_pass pass_free_datastructures =
+static struct tree_opt_pass pass_free_cfg_annotations =
{
NULL, /* name */
NULL, /* gate */
- execute_free_datastructures, /* execute */
+ execute_free_cfg_annotations, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
@@ -157,7 +186,6 @@ static struct tree_opt_pass pass_free_datastructures =
0, /* todo_flags_finish */
0 /* letter */
};
-
/* Pass: fixup_cfg - IPA passes or compilation of earlier functions might've
changed some properties - such as marked functions nothrow. Remove now
redundant edges and basic blocks. */
@@ -387,6 +415,7 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_warn_function_noreturn);
NEXT_PASS (pass_mudflap_2);
NEXT_PASS (pass_free_datastructures);
+ NEXT_PASS (pass_free_cfg_annotations);
NEXT_PASS (pass_expand);
NEXT_PASS (pass_rest_of_compilation);
*p = NULL;