diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2009-05-28 06:49:37 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2009-05-28 06:49:37 +0000 |
commit | 89fbbe4e180bff46aa797f13cf7e04ef9bffe344 (patch) | |
tree | 7a9076943d7e759fd36b9ae5653dd380ef72e61d /gcc | |
parent | c0ba77370f931c5f7079350a3a70475fca7d4487 (diff) | |
download | gcc-89fbbe4e180bff46aa797f13cf7e04ef9bffe344.zip gcc-89fbbe4e180bff46aa797f13cf7e04ef9bffe344.tar.gz gcc-89fbbe4e180bff46aa797f13cf7e04ef9bffe344.tar.bz2 |
tree-ssa-live.c (remove_unused_locals): Skip when not optimizing.
* tree-ssa-live.c (remove_unused_locals): Skip when not optimizing.
Simplify other tests involving optimize.
From-SVN: r147939
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-live.c | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6920b5a..544c988 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-05-28 Alexandre Oliva <aoliva@redhat.com> + + * tree-ssa-live.c (remove_unused_locals): Skip when not optimizing. + Simplify other tests involving optimize. + 2009-05-27 Tom Tromey <tromey@redhat.com> * unwind-dw2.c (_Unwind_DebugHook): New function. diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index 3c31766..a02b1c5 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -639,6 +639,12 @@ remove_unused_locals (void) var_ann_t ann; bitmap global_unused_vars = NULL; + /* Removing declarations from lexical blocks when not optimizing is + not only a waste of time, it actually causes differences in stack + layout. */ + if (!optimize) + return; + mark_scope_block_unused (DECL_INITIAL (current_function_decl)); /* Assume all locals are unused. */ @@ -701,8 +707,7 @@ remove_unused_locals (void) if (TREE_CODE (var) != FUNCTION_DECL && (!(ann = var_ann (var)) - || !ann->used) - && (optimize || DECL_ARTIFICIAL (var))) + || !ann->used)) { if (is_global_var (var)) { @@ -761,8 +766,7 @@ remove_unused_locals (void) && TREE_CODE (t) != PARM_DECL && TREE_CODE (t) != RESULT_DECL && !(ann = var_ann (t))->used - && !TREE_ADDRESSABLE (t) - && (optimize || DECL_ARTIFICIAL (t))) + && !TREE_ADDRESSABLE (t)) remove_referenced_var (t); remove_unused_scope_block_p (DECL_INITIAL (current_function_decl)); if (dump_file && (dump_flags & TDF_DETAILS)) |