aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
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 aeb2361..bb60c33 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);