From: Jan Hubicka Date: Fri, 3 Sep 2004 22:38:33 +0000 (+0200) Subject: cfg.c (free_edge): Use ggc_free. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=80d8221e0c34594db9939116db262200b4b7c242;p=gcc.git cfg.c (free_edge): Use ggc_free. 2004-09-04 Jan Hubicka * cfg.c (free_edge): Use ggc_free. (expunge_block): Use ggc_free. * passes.c (rest_of_clean_state): Free after compilation. * tree-ssa.c (delete_tree_ssa): Free annotations; call release_defs * tree-ssanames.c (release_defs): Ignore non-SSA_NAME arguments. From-SVN: r87058 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8fbba52873..ca212cd504c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-09-04 Jan Hubicka + + * cfg.c (free_edge): Use ggc_free. + (expunge_block): Use ggc_free. + * passes.c (rest_of_clean_state): Free after compilation. + * tree-ssa.c (delete_tree_ssa): Free annotations; call release_defs + * tree-ssanames.c (release_defs): Ignore non-SSA_NAME arguments. + 2004-09-03 James E Wilson * tree-ssa-alias.c (may_be_aliased): Move TREE_STATIC check after diff --git a/gcc/cfg.c b/gcc/cfg.c index 003d09e05ff..19c242b99c9 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -134,7 +134,7 @@ static void free_edge (edge e ATTRIBUTE_UNUSED) { n_edges--; - /* ggc_free (e); */ + ggc_free (e); } /* Free the memory associated with the edge structures. */ @@ -269,7 +269,7 @@ expunge_block (basic_block b) unlink_block (b); BASIC_BLOCK (b->index) = NULL; n_basic_blocks--; - /* ggc_free (b); */ + ggc_free (b); } /* Create an edge connecting SRC and DEST with flags FLAGS. Return newly diff --git a/gcc/passes.c b/gcc/passes.c index 783e33d8bbc..7c6f0024604 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1685,6 +1685,7 @@ rest_of_clean_state (void) /* We're done with this function. Free up memory if we can. */ free_after_parsing (cfun); + free_after_compilation (cfun); } diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 13104fdf818..f6037c2b5f9 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -641,13 +641,22 @@ delete_tree_ssa (void) /* Remove annotations from every tree in the function. */ FOR_EACH_BB (bb) for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) - bsi_stmt (bsi)->common.ann = NULL; + { + tree stmt = bsi_stmt (bsi); + release_defs (stmt); + ggc_free (stmt->common.ann); + stmt->common.ann = NULL; + } /* Remove annotations from every referenced variable. */ if (referenced_vars) { for (i = 0; i < num_referenced_vars; i++) - referenced_var (i)->common.ann = NULL; + { + tree var = referenced_var (i); + ggc_free (var->common.ann); + var->common.ann = NULL; + } referenced_vars = NULL; } diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index 1e947d69f1e..ad03a583227 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -302,7 +302,8 @@ release_defs (tree stmt) ssa_op_iter iter; FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS) - release_ssa_name (def); + if (TREE_CODE (def) == SSA_NAME) + release_ssa_name (def); }