aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraoliva <>2009-05-12 04:43:51 +0000
committeraoliva <>2009-05-12 04:43:51 +0000
commitdf3fd90f561f5984582a9e12aa343a33b3fe953d (patch)
treea3077aa1b4870632abdf7c16a3483990e36de85a
parent3d4728326f6e9b19bb81c56c5018288bfb21dc5f (diff)
* tree.c (iterative_hash_pointer): Delete.
(iterative_hash_expr): Short-circuit handling of NULL pointer. Hash UIDs and versions of SSA names. Don't special-case built-in function declarations.
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree.c31
2 files changed, 13 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 66313957489..64566c0d9ed 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2009-05-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * tree.c (iterative_hash_pointer): Delete.
+ (iterative_hash_expr): Short-circuit handling of NULL pointer.
+ Hash UIDs and versions of SSA names. Don't special-case built-in
+ function declarations.
+
2009-05-11 Ian Lance Taylor <iant@google.com>
PR bootstrap/40103
diff --git a/gcc/tree.c b/gcc/tree.c
index 295358c527b..876f43a6334 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3626,24 +3626,6 @@ iterative_hash_hashval_t (hashval_t val, hashval_t val2)
return val2;
}
-/* Produce good hash value combining PTR and VAL2. */
-static inline hashval_t
-iterative_hash_pointer (const void *ptr, hashval_t val2)
-{
- if (sizeof (ptr) == sizeof (hashval_t))
- return iterative_hash_hashval_t ((size_t) ptr, val2);
- else
- {
- hashval_t a = (hashval_t) (size_t) ptr;
- /* Avoid warnings about shifting of more than the width of the type on
- hosts that won't execute this path. */
- int zero = 0;
- hashval_t b = (hashval_t) ((size_t) ptr >> (sizeof (hashval_t) * 8 + zero));
- mix (a, b, val2);
- return val2;
- }
-}
-
/* Produce good hash value combining VAL and VAL2. */
static inline hashval_t
iterative_hash_host_wide_int (HOST_WIDE_INT val, hashval_t val2)
@@ -5330,7 +5312,7 @@ iterative_hash_expr (const_tree t, hashval_t val)
char tclass;
if (t == NULL_TREE)
- return iterative_hash_pointer (t, val);
+ return iterative_hash_hashval_t (0, val);
code = TREE_CODE (t);
@@ -5364,7 +5346,7 @@ iterative_hash_expr (const_tree t, hashval_t val)
case SSA_NAME:
/* we can just compare by pointer. */
- return iterative_hash_pointer (t, val);
+ return iterative_hash_host_wide_int (SSA_NAME_VERSION (t), val);
case TREE_LIST:
/* A list of expressions, for a CALL_EXPR or as the elements of a
@@ -5388,13 +5370,12 @@ iterative_hash_expr (const_tree t, hashval_t val)
__builtin__ form. Otherwise nodes that compare equal
according to operand_equal_p might get different
hash codes. */
- if (DECL_BUILT_IN (t))
+ if (DECL_BUILT_IN (t) && built_in_decls[DECL_FUNCTION_CODE (t)])
{
- val = iterative_hash_pointer (built_in_decls[DECL_FUNCTION_CODE (t)],
- val);
- return val;
+ t = built_in_decls[DECL_FUNCTION_CODE (t)];
+ code = TREE_CODE (t);
}
- /* else FALL THROUGH */
+ /* FALL THROUGH */
default:
tclass = TREE_CODE_CLASS (code);