re PR go/48501 (64bit-out.go, select5-out.go, tmp.go compilation times out)
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 14 Feb 2012 18:02:09 +0000 (18:02 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 14 Feb 2012 18:02:09 +0000 (18:02 +0000)
PR go/48501
runtime: Fix identity hash function for big-endian systems.

From-SVN: r184218

libgo/runtime/go-type-identity.c

index a0168e2..142edf4 100644 (file)
@@ -32,7 +32,10 @@ __go_type_hash_identity (const void *key, uintptr_t key_size)
       } u;
       u.v = 0;
       __builtin_memcpy (&u.a, key, key_size);
-      return (uintptr_t) u.v;
+      if (sizeof (uintptr_t) >= 8)
+       return (uintptr_t) u.v;
+      else
+       return (uintptr_t) ((u.v >> 32) ^ (u.v & 0xffffffff));
     }
 
   ret = 5381;