From c72321c9a7c869ae5cb7f5bbec1ea4e8c8d3c50a Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 20 Jul 2008 18:06:51 +0200 Subject: cgraph.c (cgraph_add_new_function): Do early local passes. * cgraph.c (cgraph_add_new_function): Do early local passes. * tree-nrv.c (gate_pass_return_slot): New gate. (pass_nrv): Add the gate. * tree-ssa-coalese.c (hash_ssa_name_by_var, eq_ssa_name_by_var): New functions. (coalesce_ssa_name): Coalesce SSA names. * tree-ssa-live.c (remove_unused_locals): Be more conservative when not optimizing so unused user vars remains visible. * common.opt (flag_tree_ter): Always enable by default. * tree-ssa-ter.c: Include flags.h (is_replaceable_p): Check that locations match; when aliasing is missing be conservative about loads. * tree-optimize.c (gate_init_datastructures): Remove. (pass_init_datastructures): New. * passes.c: Reorder passes so we always go into SSA. From-SVN: r138010 --- gcc/tree-ssa-live.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gcc/tree-ssa-live.c') diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index c277980..a5f7596 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -582,7 +582,8 @@ remove_unused_locals (void) var_ann_t ann; bitmap global_unused_vars = NULL; - mark_scope_block_unused (DECL_INITIAL (current_function_decl)); + if (optimize) + mark_scope_block_unused (DECL_INITIAL (current_function_decl)); /* Assume all locals are unused. */ FOR_EACH_REFERENCED_VAR (t, rvi) var_ann (t)->used = false; @@ -661,7 +662,8 @@ remove_unused_locals (void) if (TREE_CODE (var) == VAR_DECL && is_global_var (var) - && bitmap_bit_p (global_unused_vars, DECL_UID (var))) + && bitmap_bit_p (global_unused_vars, DECL_UID (var)) + && (optimize || DECL_ARTIFICIAL (var))) *cell = TREE_CHAIN (*cell); else cell = &TREE_CHAIN (*cell); @@ -681,9 +683,11 @@ remove_unused_locals (void) && TREE_CODE (t) != RESULT_DECL && !(ann = var_ann (t))->used && !ann->symbol_mem_tag - && !TREE_ADDRESSABLE (t)) + && !TREE_ADDRESSABLE (t) + && (optimize || DECL_ARTIFICIAL (t))) remove_referenced_var (t); - remove_unused_scope_block_p (DECL_INITIAL (current_function_decl)); + if (optimize) + remove_unused_scope_block_p (DECL_INITIAL (current_function_decl)); } -- cgit v1.1