OSDN Git Service

* tree.c (iterative_hash_pointer): Delete.
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 May 2009 05:43:51 +0000 (05:43 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 May 2009 05:43:51 +0000 (05:43 +0000)
(iterative_hash_expr): Short-circuit handling of NULL pointer.
Hash UIDs and versions of SSA names.  Don't special-case built-in
function declarations.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147414 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree.c

index 6631395..64566c0 100644 (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
index 295358c..876f43a 100644 (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);