summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-21 14:57:33 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-21 14:57:33 +0000
commit1bc4cf65767dd54b45e55f00fe67b608a40e530e (patch)
tree755d1d58491daff3fda926aecf62711e4f7c668b /gcc/cfgexpand.c
parentda82f093f0cb283081874fb700bdf06dd9f59628 (diff)
downloadgcc-1bc4cf65767dd54b45e55f00fe67b608a40e530e.tar.gz
PR debug/47106
* cfgexpand.c (account_used_vars_for_block): Only account vars that are annotated as used. (estimated_stack_frame_size): Don't set TREE_USED. * tree-dfa.c (create_var_ann): Mark variable as used. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index aeb23610565..bb60c337084 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1325,7 +1325,7 @@ account_used_vars_for_block (tree block, bool toplevel)
/* Expand all variables at this level. */
for (t = BLOCK_VARS (block); t ; t = DECL_CHAIN (t))
- if (TREE_USED (t))
+ if (var_ann (t) && var_ann (t)->used)
size += expand_one_var (t, toplevel, false);
/* Expand all variables at containing levels. */
@@ -1389,9 +1389,10 @@ estimated_stack_frame_size (tree decl)
FOR_EACH_LOCAL_DECL (cfun, ix, var)
{
+ /* TREE_USED marks local variables that do not appear in lexical
+ blocks. We don't want to expand those that do twice. */
if (TREE_USED (var))
size += expand_one_var (var, true, false);
- TREE_USED (var) = 1;
}
size += account_used_vars_for_block (outer_block, true);