diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-05 13:53:54 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-05 13:53:54 +0000 |
commit | db22d3cc2fb885dec7aea38a58ee7775d93d7dd1 (patch) | |
tree | 6cf1f63c9110bc738fd2520546f623d74c55ebb4 /gcc/gimple-low.c | |
parent | 30afe54504cdc744a64e0473bdb27995c07d76d4 (diff) | |
download | gcc-db22d3cc2fb885dec7aea38a58ee7775d93d7dd1.tar.gz |
2006-01-05 Richard Guenther <rguenther@suse.de>
Diego Novillo <dnovillo@redhat.com>
* tree-pass.h (TODO_remove_unused_locals): Define.
* gimple-low.c (expand_var_p, remove_useless_vars,
pass_remove_useless_vars): Remove. Update all users.
* tree-ssa-live.c (mark_all_vars_used_1): Handle SSA names.
(remove_unused_locals): New function.
* tree-flow.h (remove_unused_locals): Declare.
* passes.c (execute_todo): Call remove_unused_locals if
TODO_remove_unused_locals is set.
* tree-into-ssa.c (pass_build_ssa): Add TODO_remove_unused_locals.
* tree-ssa-dce.c (pass_dce): Likewise.
* tree-outof-ssa.c (pass_del_ssa): Likewise.
* gcc.dg/tree-ssa/loop-11.c: Deal with removed vars pass.
* gcc.dg/tree-ssa/loop-8.c: Likewise.
* gcc.dg/tree-ssa/loop-1.c: Likewise.
* gcc.dg/tree-ssa/pr23294.c: Likewise.
* gcc.dg/tree-ssa/pr21985.c: Likewise.
* gcc.dg/tree-ssa/loop-14.c: Likewise.
* gcc.dg/tree-ssa/loop-2.c: Likewise.
* gcc.dg/tree-ssa/loop-3.c: Likewise.
* gcc.dg/tree-ssa/loop-4.c: Likewise.
* gcc.dg/tree-ssa/pr21171.c: Likewise.
* gcc.dg/tree-ssa/loop-5.c: Likewise.
* gcc.dg/tree-ssa/loop-10.c: Likewise.
* gcc.dg/tree-ssa/loop-6.c: Likewise.
* treelang/compile/extravar.tree: Likewise.
* g++.dg/tree-ssa/ssa-cast-1.C: Likewise.
* g++.dg/tree-ssa/pointer-reference-alias.C: Likewise.
* g++.dg/tree-ssa/ssa-sra-1.C: Likewise.
* g++.dg/tree-ssa/ssa-sra-2.C: Likewise.
* gcc.dg/tree-ssa/20031106-6.c: Disable SRA.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109379 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r-- | gcc/gimple-low.c | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 44171341d31..de0f6f24ead 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -55,7 +55,6 @@ static void lower_stmt (tree_stmt_iterator *, struct lower_data *); static void lower_bind_expr (tree_stmt_iterator *, struct lower_data *); static void lower_cond_expr (tree_stmt_iterator *, struct lower_data *); static void lower_return_expr (tree_stmt_iterator *, struct lower_data *); -static bool expand_var_p (tree); /* Lowers the body of current_function_decl. */ @@ -533,82 +532,6 @@ record_vars (tree vars) } } -/* Check whether to expand a variable VAR. */ - -static bool -expand_var_p (tree var) -{ - struct var_ann_d *ann; - - if (TREE_CODE (var) != VAR_DECL) - return true; - - /* Leave statics and externals alone. */ - if (TREE_STATIC (var) || DECL_EXTERNAL (var)) - return true; - - /* Remove all unused local variables. */ - ann = var_ann (var); - if (!ann || !ann->used) - return false; - - return true; -} - -/* Throw away variables that are unused. */ - -static void -remove_useless_vars (void) -{ - tree var, *cell; - FILE *df = NULL; - - if (dump_file && (dump_flags & TDF_DETAILS)) - { - df = dump_file; - fputs ("Discarding as unused:\n", df); - } - - for (cell = &cfun->unexpanded_var_list; *cell; ) - { - var = TREE_VALUE (*cell); - - if (!expand_var_p (var)) - { - if (df) - { - fputs (" ", df); - print_generic_expr (df, var, dump_flags); - fputc ('\n', df); - } - - *cell = TREE_CHAIN (*cell); - continue; - } - - cell = &TREE_CHAIN (*cell); - } - - if (df) - fputc ('\n', df); -} - -struct tree_opt_pass pass_remove_useless_vars = -{ - "vars", /* name */ - NULL, /* gate */ - remove_useless_vars, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - 0, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ -}; /* Mark BLOCK used if it has a used variable in it, then recurse over its subblocks. */ |