+2004-05-20 Zack Weinberg <zack@codesourcery.com>
+
+ * cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node)
+ (cgraph_varpool_hash_node, eq_cgraph_varpool_node)
+ (cgraph_varpool_node): Hash on the pointer to the decl, not
+ the DECL_UID. Fixes 64-bit bootstrap failure.
+
2004-05-20 Richard Earnshaw <rearnsha@arm.com>
* arm.md (ite_ne_zeroextractsi, ite_ne_zeroextractsi_shifted): Ensure
static hashval_t
hash_node (const void *p)
{
- return ((hashval_t) DECL_UID (((struct cgraph_node *) p)->decl));
+ return htab_hash_pointer (((struct cgraph_node *) p)->decl);
}
/* Returns nonzero if P1 and P2 are equal. */
static int
eq_node (const void *p1, const void *p2)
{
- return (DECL_UID (((struct cgraph_node *) p1)->decl) == (unsigned int)p2);
+ return (void *)((struct cgraph_node *) p1)->decl == p2;
}
/* Allocate new callgraph node and insert it into basic data structures. */
cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
slot = (struct cgraph_node **)
- htab_find_slot_with_hash (cgraph_hash,
- (void *)DECL_UID (decl),
- (hashval_t)DECL_UID (decl),
- INSERT);
+ htab_find_slot_with_hash (cgraph_hash, decl,
+ htab_hash_pointer (decl), INSERT);
if (*slot)
return *slot;
if (node->next)
node->next->previous = node->previous;
slot =
- htab_find_slot_with_hash (cgraph_hash,
- (void *)DECL_UID (node->decl),
- (hashval_t)DECL_UID (node->decl),
- NO_INSERT);
+ htab_find_slot_with_hash (cgraph_hash, node->decl,
+ htab_hash_pointer (node->decl), NO_INSERT);
if (*slot == node)
{
if (node->next_clone)
static hashval_t
cgraph_varpool_hash_node (const void *p)
{
- return ((hashval_t) DECL_UID (((struct cgraph_varpool_node *) p)->decl));
+ return htab_hash_pointer (((struct cgraph_varpool_node *) p)->decl);
}
/* Returns nonzero if P1 and P2 are equal. */
static int
eq_cgraph_varpool_node (const void *p1, const void *p2)
{
- return (DECL_UID (((struct cgraph_varpool_node *) p1)->decl)
- == (unsigned int) p2);
-
+ return (void *)((struct cgraph_varpool_node *) p1)->decl == p2;
}
/* Return cgraph_varpool node assigned to DECL. Create new one when needed. */
cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node,
eq_cgraph_varpool_node, NULL);
slot = (struct cgraph_varpool_node **)
- htab_find_slot_with_hash (cgraph_varpool_hash,
- (void *)DECL_UID (decl),
- (hashval_t)DECL_UID (decl),
- INSERT);
+ htab_find_slot_with_hash (cgraph_varpool_hash, decl,
+ htab_hash_pointer (decl), INSERT);
if (*slot)
return *slot;
node = ggc_alloc_cleared (sizeof (*node));