Commit 30719c65 by Zack Weinberg Committed by Zack Weinberg

* 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.

From-SVN: r82059
parent 69260355
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> 2004-05-20 Richard Earnshaw <rearnsha@arm.com>
* arm.md (ite_ne_zeroextractsi, ite_ne_zeroextractsi_shifted): Ensure * arm.md (ite_ne_zeroextractsi, ite_ne_zeroextractsi_shifted): Ensure
......
...@@ -139,7 +139,7 @@ static int eq_node (const void *, const void *); ...@@ -139,7 +139,7 @@ static int eq_node (const void *, const void *);
static hashval_t static hashval_t
hash_node (const void *p) 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. */ /* Returns nonzero if P1 and P2 are equal. */
...@@ -147,7 +147,7 @@ hash_node (const void *p) ...@@ -147,7 +147,7 @@ hash_node (const void *p)
static int static int
eq_node (const void *p1, const void *p2) 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. */ /* Allocate new callgraph node and insert it into basic data structures. */
...@@ -181,10 +181,8 @@ cgraph_node (tree decl) ...@@ -181,10 +181,8 @@ cgraph_node (tree decl)
cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL); cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
slot = (struct cgraph_node **) slot = (struct cgraph_node **)
htab_find_slot_with_hash (cgraph_hash, htab_find_slot_with_hash (cgraph_hash, decl,
(void *)DECL_UID (decl), htab_hash_pointer (decl), INSERT);
(hashval_t)DECL_UID (decl),
INSERT);
if (*slot) if (*slot)
return *slot; return *slot;
...@@ -326,10 +324,8 @@ cgraph_remove_node (struct cgraph_node *node) ...@@ -326,10 +324,8 @@ cgraph_remove_node (struct cgraph_node *node)
if (node->next) if (node->next)
node->next->previous = node->previous; node->next->previous = node->previous;
slot = slot =
htab_find_slot_with_hash (cgraph_hash, htab_find_slot_with_hash (cgraph_hash, node->decl,
(void *)DECL_UID (node->decl), htab_hash_pointer (node->decl), NO_INSERT);
(hashval_t)DECL_UID (node->decl),
NO_INSERT);
if (*slot == node) if (*slot == node)
{ {
if (node->next_clone) if (node->next_clone)
...@@ -532,7 +528,7 @@ dump_cgraph (FILE *f) ...@@ -532,7 +528,7 @@ dump_cgraph (FILE *f)
static hashval_t static hashval_t
cgraph_varpool_hash_node (const void *p) 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. */ /* Returns nonzero if P1 and P2 are equal. */
...@@ -540,9 +536,7 @@ cgraph_varpool_hash_node (const void *p) ...@@ -540,9 +536,7 @@ cgraph_varpool_hash_node (const void *p)
static int static int
eq_cgraph_varpool_node (const void *p1, const void *p2) eq_cgraph_varpool_node (const void *p1, const void *p2)
{ {
return (DECL_UID (((struct cgraph_varpool_node *) p1)->decl) return (void *)((struct cgraph_varpool_node *) p1)->decl == p2;
== (unsigned int) p2);
} }
/* Return cgraph_varpool node assigned to DECL. Create new one when needed. */ /* Return cgraph_varpool node assigned to DECL. Create new one when needed. */
...@@ -559,10 +553,8 @@ cgraph_varpool_node (tree decl) ...@@ -559,10 +553,8 @@ cgraph_varpool_node (tree decl)
cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node, cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node,
eq_cgraph_varpool_node, NULL); eq_cgraph_varpool_node, NULL);
slot = (struct cgraph_varpool_node **) slot = (struct cgraph_varpool_node **)
htab_find_slot_with_hash (cgraph_varpool_hash, htab_find_slot_with_hash (cgraph_varpool_hash, decl,
(void *)DECL_UID (decl), htab_hash_pointer (decl), INSERT);
(hashval_t)DECL_UID (decl),
INSERT);
if (*slot) if (*slot)
return *slot; return *slot;
node = ggc_alloc_cleared (sizeof (*node)); node = ggc_alloc_cleared (sizeof (*node));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment