aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 46fcfc1..785ae1b 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -503,24 +503,23 @@ referenced_var_lookup (struct function *fn, unsigned int uid)
Return true if it required insertion. */
static bool
-referenced_var_check_and_insert (tree to)
+referenced_var_check_and_insert (tree to, struct function *fn)
{
- tree h, *loc;
+ tree *loc;
struct tree_decl_minimal in;
unsigned int uid = DECL_UID (to);
in.uid = uid;
- h = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), &in, uid);
- if (h)
+ loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (fn),
+ &in, uid, INSERT);
+ if (*loc)
{
/* DECL_UID has already been entered in the table. Verify that it is
the same entry as TO. See PR 27793. */
- gcc_assert (h == to);
+ gcc_assert (*loc == to);
return false;
}
- loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (cfun),
- &in, uid, INSERT);
*loc = to;
return true;
}
@@ -575,7 +574,7 @@ set_default_def (tree var, tree def)
/* Add VAR to the list of referenced variables if it isn't already there. */
bool
-add_referenced_var (tree var)
+add_referenced_var_1 (tree var, struct function *fn)
{
gcc_checking_assert (TREE_CODE (var) == VAR_DECL
|| TREE_CODE (var) == PARM_DECL
@@ -585,7 +584,7 @@ add_referenced_var (tree 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))
+ if (referenced_var_check_and_insert (var, fn))
return true;
return false;