From 81d080336384ece7e0f3996541093fb348b9f689 Mon Sep 17 00:00:00 2001 From: dnovillo Date: Thu, 22 Jul 2004 16:39:49 +0000 Subject: * tree-into-ssa.c (set_livein_block): Fix typo in comment. (rewrite_ssa_into_ssa): Start iterating over SSA names at 1. Release SSA names that have been re-renamed. * tree-phinodes.c (make_phi_node): Set same TREE_TYPE as the variable. * tree-ssa-alias.c (init_alias_info): If aliases have been computed before, clear existing alias information. (create_name_tags): Do no fixup PT_ANYTHING pointers. If the new name tag for a pointer is different than the one it had before, mark the old tag for renaming. (replace_may_alias): New function. (group_aliases): Call it. (setup_pointers_and_addressables): Always call get_tmt_for. (maybe_create_global_var): Don't create .GLOBAL_VAR more than once. (set_pt_anything): New local function. (set_pt_malloc): New local function. (merge_pointed_to_info): Don't merge pointed-to variables from the original pointer if the destination is pointing to an unknown location. (add_pointed_to_expr): Call set_pt_anything and set_pt_malloc. (add_pointed_to_var): Do not add a variable to the points-to set if the pointer is already pointing to anywhere. (collect_points_to_info_r): If the defining statement is a PHI node, only merge pointed-to information if the argument has already been visited. (get_tmt_for): Only create a new tag if the pointer didn't have one already. (dump_alias_info): Emit more information. (dump_points_to_info_for): Likewise. * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't try to get the annotation of an SSA_NAME. * tree-ssa-operands.c (add_stmt_operand): Only check for empty alias sets when checking is enabled. * tree-ssa-pre.c (need_eh_cleanup): New local variable. (eliminate): Mark basic blocks that will need EH information cleaned up. (init_pre): Split ENTRY_BLOCK->0 if block 0 has more than one predecessor. Initialize need_eh_cleanup. (fini_pre): Call tree_purge_all_dead_eh_edges and cleanup_tree_cfg if needed. Free need_eh_cleanup. * tree-ssa.c (verify_ssa_name): New function. (verify_def): Call it. Re-arrange to avoid printing too many error messages. (verify_use): Likewise. (verify_phi_args): Likewise. (verify_flow_insensitive_alias_info): New function. (verify_flow_sensitive_alias_info): New function. (verify_alias_info): New function. (verify_ssa): Call verify_alias_info. Clear TREE_VISITED on all the SSA_NAMEs before scanning the program. Re-arrange to avoid printing too many error messages. * tree-ssanames.c (make_ssa_name): Clear SSA_NAME_IN_FREE_LIST. (release_ssa_name): Never release a default definition. (release_defs): New function. * tree.h: Declare it. * tree-ssa-dce.c (remove_dead_stmt): Call it. * tree-ssa.c (walk_use_def_chains_1): Add new argument IS_DFS. If true, do a depth-first search. Do a breadht-first search, otherwise. (walk_use_def_chains): Add new argument IS_DFS. Update all users. * tree-flow.h (walk_use_def_chains): Update prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85052 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-ssanames.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gcc/tree-ssanames.c') diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index d4982706676..2785e530b3c 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -160,6 +160,7 @@ make_ssa_name (tree var, tree stmt) SSA_NAME_VAR (t) = var; SSA_NAME_DEF_STMT (t) = stmt; SSA_NAME_PTR_INFO (t) = NULL; + SSA_NAME_IN_FREE_LIST (t) = 0; return t; } @@ -176,6 +177,11 @@ make_ssa_name (tree var, tree stmt) void release_ssa_name (tree var) { + /* Never release the default definition for a symbol. It's a + special SSA name that should always exist once it's created. */ + if (var == var_ann (SSA_NAME_VAR (var))->default_def) + return; + /* release_ssa_name can be called multiple times on a single SSA_NAME. However, it should only end up on our free list one time. We keep a status bit in the SSA_NAME node itself to indicate it has @@ -216,4 +222,31 @@ duplicate_ssa_name (tree name, tree stmt) return new_name; } + +/* Release all the SSA_NAMEs created by STMT. */ + +void +release_defs (tree stmt) +{ + size_t i; + v_may_def_optype v_may_defs; + v_must_def_optype v_must_defs; + def_optype defs; + stmt_ann_t ann; + + ann = stmt_ann (stmt); + defs = DEF_OPS (ann); + v_may_defs = V_MAY_DEF_OPS (ann); + v_must_defs = V_MUST_DEF_OPS (ann); + + for (i = 0; i < NUM_DEFS (defs); i++) + release_ssa_name (DEF_OP (defs, i)); + + for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++) + release_ssa_name (V_MAY_DEF_RESULT (v_may_defs, i)); + + for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++) + release_ssa_name (V_MUST_DEF_OP (v_must_defs, i)); +} + #include "gt-tree-ssanames.h" -- cgit v1.2.1