Commit 1368453c by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/29299 (gcc "used" attribute has no effect on local-scope static variables)

	PR middle-end/29299
	* cfgexpand.c (expand_used_vars_for_block): Vars marked used by user
	are used.

From-SVN: r117863
parent c4c7fca3
2006-10-18 Jan Hubicka <jh@suse.cz>
PR middle-end/29299
* cfgexpand.c (expand_used_vars_for_block): Vars marked used by user
are used.
2006-10-18 Marcin Dalecki <martin@dalecki.de> 2006-10-18 Marcin Dalecki <martin@dalecki.de>
* omp-low.c (expand_parallel_call): Use BSI_SAME_STMT instead of * omp-low.c (expand_parallel_call): Use BSI_SAME_STMT instead of
......
...@@ -764,7 +764,12 @@ expand_used_vars_for_block (tree block, bool toplevel) ...@@ -764,7 +764,12 @@ expand_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 = TREE_CHAIN (t)) for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
if (TREE_USED (t)) if (TREE_USED (t)
/* Force local static variables to be output when marked by
used attribute. For unit-at-a-time, cgraph code already takes
care of this. */
|| (!flag_unit_at_a_time && TREE_STATIC (t)
&& DECL_PRESERVE_P (t)))
expand_one_var (t, toplevel); expand_one_var (t, toplevel);
this_sv_num = stack_vars_num; this_sv_num = stack_vars_num;
......
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