aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2009-05-12 05:43:51 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2009-05-12 05:43:51 +0000
commit72b9acff14f5486a970e94f412e03051fc7d85a4 (patch)
treea3077aa1b4870632abdf7c16a3483990e36de85a /gcc/tree.c
parentb7dd69ac5b7f03bf9a746eeac8575b21f0f1a808 (diff)
downloadgcc-72b9acff14f5486a970e94f412e03051fc7d85a4.zip
gcc-72b9acff14f5486a970e94f412e03051fc7d85a4.tar.gz
gcc-72b9acff14f5486a970e94f412e03051fc7d85a4.tar.bz2
tree.c (iterative_hash_pointer): Delete.
* 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. From-SVN: r147414
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 295358c..876f43a 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);