aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/tree-ssa-live.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/tree-ssa-live.c')
-rw-r--r--gcc-4.8/gcc/tree-ssa-live.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc-4.8/gcc/tree-ssa-live.c b/gcc-4.8/gcc/tree-ssa-live.c
index a72e9d5a6..8456d7a09 100644
--- a/gcc-4.8/gcc/tree-ssa-live.c
+++ b/gcc-4.8/gcc/tree-ssa-live.c
@@ -394,7 +394,8 @@ mark_all_vars_used_1 (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
/* When a global var becomes used for the first time also walk its
initializer (non global ones don't have any). */
- if (set_is_used (t) && is_global_var (t))
+ if (set_is_used (t) && is_global_var (t)
+ && DECL_CONTEXT (t) == current_function_decl)
mark_all_vars_used (&DECL_INITIAL (t));
}
/* remove_unused_scope_block_p requires information about labels