summaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-23 12:25:41 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-23 12:25:41 +0000
commitad75582e24a80fad6b6caec714f8414b450137bf (patch)
treeba5ec63e854787f6350620ade1d6adb1b183582e /gcc/tree-dfa.c
parentf963f90b5b8c638dcbac2cd278671d4e1e1615dc (diff)
downloadgcc-ad75582e24a80fad6b6caec714f8414b450137bf.tar.gz
2012-05-23 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (add_referenced_var_1): Do not add global vars. * tree-ssa-live.c (mark_all_vars_used_1): Handle global vars via the global_unused_vars bitmap. (remove_unused_locals): Handle global vars in local-decls via a global_unused_vars bitmap instead of the used flag in the var annotation. Simplify global variable handling and removal. * gcc.dg/torture/pr39074-2.c: Adjust. * gcc.dg/torture/pr39074.c: Likewise. * gcc.dg/torture/pta-structcopy-1.c: Likewise. * gcc.dg/tree-ssa/alias-19.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187800 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 31cafa09a73..e9db01d8b82 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -581,6 +581,11 @@ add_referenced_var_1 (tree var, struct function *fn)
|| TREE_CODE (var) == PARM_DECL
|| TREE_CODE (var) == RESULT_DECL);
+ if (!(TREE_CODE (var) == VAR_DECL
+ && VAR_DECL_IS_VIRTUAL_OPERAND (var))
+ && is_global_var (var))
+ return false;
+
if (!*DECL_VAR_ANN_PTR (var))
create_var_ann (var);