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
This commit is contained in:
Alexandre Oliva 2009-05-12 05:43:51 +00:00 committed by Alexandre Oliva
parent b7dd69ac5b
commit 72b9acff14
2 changed files with 13 additions and 25 deletions

View File

@ -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

View File

@ -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);