Commit 1c7d0b34 by Alexandre Oliva Committed by Alexandre Oliva

re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining…

re PR debug/47106 (-fcompare-debug failure (length) with  -fpartial-inlining -flto -fconserve-stack)

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.

From-SVN: r169093
parent f99cc488
2011-01-21 Alexandre Oliva <aoliva@redhat.com>
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.
2011-01-21 Richard Guenther <rguenther@suse.de> 2011-01-21 Richard Guenther <rguenther@suse.de>
PR middle-end/47395 PR middle-end/47395
......
...@@ -1325,7 +1325,7 @@ account_used_vars_for_block (tree block, bool toplevel) ...@@ -1325,7 +1325,7 @@ account_used_vars_for_block (tree block, bool toplevel)
/* Expand all variables at this level. */ /* Expand all variables at this level. */
for (t = BLOCK_VARS (block); t ; t = DECL_CHAIN (t)) 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); size += expand_one_var (t, toplevel, false);
/* Expand all variables at containing levels. */ /* Expand all variables at containing levels. */
...@@ -1389,9 +1389,10 @@ estimated_stack_frame_size (tree decl) ...@@ -1389,9 +1389,10 @@ estimated_stack_frame_size (tree decl)
FOR_EACH_LOCAL_DECL (cfun, ix, var) 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)) if (TREE_USED (var))
size += expand_one_var (var, true, false); size += expand_one_var (var, true, false);
TREE_USED (var) = 1;
} }
size += account_used_vars_for_block (outer_block, true); size += account_used_vars_for_block (outer_block, true);
......
...@@ -137,6 +137,9 @@ create_var_ann (tree t) ...@@ -137,6 +137,9 @@ create_var_ann (tree t)
ann = ggc_alloc_cleared_var_ann_d (); ann = ggc_alloc_cleared_var_ann_d ();
*DECL_VAR_ANN_PTR (t) = ann; *DECL_VAR_ANN_PTR (t) = ann;
/* Assume the variable is used, at least for now. */
ann->used = true;
return ann; return ann;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment