From 7bdfd72e8db8e421d5c52c263ef4766c8bac2599 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Fri, 11 Oct 2002 01:28:28 +0000 Subject: [PATCH] decl.c (typename_hash): Use htab_hash_pointer. cp: * decl.c (typename_hash): Use htab_hash_pointer. gcc: * fold-const.c (size_htab_hash): Use htab_hash_pointer. * function.c (insns_for_mem_hash): Likewise. * varasm.c (STRHASH): Likewise. java: * class.c (JAVA_TREEHASHHASH_H): Use htab_hash_pointer. From-SVN: r58036 --- gcc/ChangeLog | 6 ++++++ gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 4 ++-- gcc/fold-const.c | 2 +- gcc/function.c | 2 +- gcc/java/ChangeLog | 4 ++++ gcc/java/class.c | 2 +- gcc/varasm.c | 2 +- 8 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a7d8310a2c3e..badf569c1e31 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-10-10 Kaveh R. Ghazi + + * fold-const.c (size_htab_hash): Use htab_hash_pointer. + * function.c (insns_for_mem_hash): Likewise. + * varasm.c (STRHASH): Likewise. + 2002-10-10 Stuart Hastings * cse.c (struct cse_reg_info): Add subreg_ticked. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8261bc95de7c..0c5af6eea00d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2002-10-10 Kaveh R. Ghazi + + * decl.c (typename_hash): Use htab_hash_pointer. + 2002-10-10 Jim Wilson * decl.c (duplicate_decls): Don't call decl_attributes. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ad083d0058c7..735aa1ba2e41 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5516,8 +5516,8 @@ typename_hash (k) hashval_t hash; tree t = (tree) k; - hash = (((hashval_t) TYPE_CONTEXT (t)) - ^ ((hashval_t) DECL_NAME (TYPE_NAME (t)))); + hash = (htab_hash_pointer (TYPE_CONTEXT (t)) + ^ htab_hash_pointer (DECL_NAME (TYPE_NAME (t)))); return hash; } diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 2e869017dee7..6da2d914f244 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -1346,7 +1346,7 @@ size_htab_hash (x) tree t = (tree) x; return (TREE_INT_CST_HIGH (t) ^ TREE_INT_CST_LOW (t) - ^ (hashval_t) ((long) TREE_TYPE (t) >> 3) + ^ htab_hash_pointer (TREE_TYPE (t)) ^ (TREE_OVERFLOW (t) << 20)); } diff --git a/gcc/function.c b/gcc/function.c index 374ed3c4b895..d39fca3b4f92 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3281,7 +3281,7 @@ insns_for_mem_hash (k) { /* Use the address of the key for the hash value. */ struct insns_for_mem_entry *m = (struct insns_for_mem_entry *) k; - return (hashval_t) m->key; + return htab_hash_pointer (m->key); } /* Return nonzero if K1 and K2 (two REGs) are the same. */ diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 367769845e53..87e6385ca9a3 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2002-10-10 Kaveh R. Ghazi + + * class.c (JAVA_TREEHASHHASH_H): Use htab_hash_pointer. + 2002-10-09 Kaveh R. Ghazi * parse.y (merge_string_cste): Add parentheses around & within |. diff --git a/gcc/java/class.c b/gcc/java/class.c index ca7acf0f8b49..c412283158c2 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -2269,7 +2269,7 @@ static int java_treetreehash_compare PARAMS ((const void *, const void *)); /* A hash table mapping trees to trees. Used generally. */ -#define JAVA_TREEHASHHASH_H(t) ((hashval_t) (t)) +#define JAVA_TREEHASHHASH_H(t) (htab_hash_pointer (t)) static hashval_t java_treetreehash_hash (k_p) diff --git a/gcc/varasm.c b/gcc/varasm.c index 80d076f21d16..2894f8938921 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2209,7 +2209,7 @@ static GTY(()) struct constant_descriptor_tree * they are actually used. This will be if something takes its address or if there is a usage of the string in the RTL of a function. */ -#define STRHASH(x) ((hashval_t) ((long) (x) >> 3)) +#define STRHASH(x) htab_hash_pointer (x) struct deferred_string GTY(()) {