summaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-21 14:53:21 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-21 14:53:21 +0000
commitc77bfbc971346dcbf1d36ac45ef4913e999bcb3b (patch)
tree13f0febe9af8ce8dfe21d99708c299d629e8aa5e /gcc/tree-dfa.c
parent7c2df6db9d123ffca895e8025864938799786aee (diff)
downloadgcc-c77bfbc971346dcbf1d36ac45ef4913e999bcb3b.tar.gz
2012-05-21 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (add_referenced_var): Do not walk DECL_INITIAL for more referenced vars. * tree-ssa-live.c (mark_all_vars_used_1): Only set the used flag on variables that have a var-annotation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187719 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 007b8192c66..46fcfc1ef1d 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -577,24 +577,16 @@ set_default_def (tree var, tree def)
bool
add_referenced_var (tree var)
{
- gcc_assert (DECL_P (var));
+ gcc_checking_assert (TREE_CODE (var) == VAR_DECL
+ || TREE_CODE (var) == PARM_DECL
+ || TREE_CODE (var) == RESULT_DECL);
+
if (!*DECL_VAR_ANN_PTR (var))
create_var_ann (var);
/* Insert VAR into the referenced_vars hash table if it isn't present. */
if (referenced_var_check_and_insert (var))
- {
- /* Scan DECL_INITIAL for pointer variables as they may contain
- address arithmetic referencing the address of other
- variables. As we are only interested in directly referenced
- globals or referenced locals restrict this to initializers
- than can refer to local variables. */
- if (DECL_INITIAL (var)
- && DECL_CONTEXT (var) == current_function_decl)
- walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
-
- return true;
- }
+ return true;
return false;
}