summaryrefslogtreecommitdiff
path: root/gcc/ipa-struct-reorg.c
diff options
context:
space:
mode:
authorolga <olga@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 14:42:54 +0000
committerolga <olga@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 14:42:54 +0000
commit0547d011053dccb9ae4d7758d565879df37a75c0 (patch)
tree2e6f3db6220868ec9928d6f32e8df7770eee63de /gcc/ipa-struct-reorg.c
parent7bb7733e98889a9f0ec01b5e22a08715fb43e8ea (diff)
downloadgcc-0547d011053dccb9ae4d7758d565879df37a75c0.tar.gz
2009-11-30 Olga Golovanevsky <olga@il.ibm.com>
PR middle-end/39806 * ipa-struct-reorg.c (new_var_eq): Use DECL_UID to hash new variables. (new_var_hash): Likewise. (is_in_new_vars_htab): Likewise. (add_to_new_vars_htab): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154811 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-struct-reorg.c')
-rw-r--r--gcc/ipa-struct-reorg.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index 0cb7ccca31b..e1dddae999e 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -569,7 +569,7 @@ static new_var
is_in_new_vars_htab (tree decl, htab_t new_vars_htab)
{
return (new_var) htab_find_with_hash (new_vars_htab, decl,
- htab_hash_pointer (decl));
+ DECL_UID (decl));
}
/* Given original variable ORIG_VAR, this function returns
@@ -1962,7 +1962,7 @@ add_to_new_vars_htab (new_var new_node, htab_t new_vars_htab)
void **slot;
slot = htab_find_slot_with_hash (new_vars_htab, new_node->orig_var,
- htab_hash_pointer (new_node->orig_var),
+ DECL_UID (new_node->orig_var),
INSERT);
*slot = new_node;
}
@@ -2254,15 +2254,19 @@ create_new_var (tree var_decl, htab_t new_vars_htab)
static hashval_t
new_var_hash (const void *x)
{
- return htab_hash_pointer (((const_new_var)x)->orig_var);
+ return DECL_UID (((const_new_var)x)->orig_var);
}
-/* This function returns nonzero if orig_var of new_var X is equal to Y. */
+/* This function returns nonzero if orig_var of new_var X
+ and tree Y have equal UIDs. */
static int
new_var_eq (const void *x, const void *y)
{
- return ((const_new_var)x)->orig_var == (const_tree)y;
+ if (DECL_P ((const_tree)y))
+ return DECL_UID (((const_new_var)x)->orig_var) == DECL_UID ((const_tree)y);
+ else
+ return 0;
}
/* This function check whether a structure type represented by STR