diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-14 18:02:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-14 18:02:09 +0000 |
commit | 95787705db5e014d9ba13ee428bb4d5a2b1f55ee (patch) | |
tree | 4011aa0cc1255851ad3f24a09ecb0b2e7db2fba9 | |
parent | 7f0dbd0aeef60a1c194bbc2c063e5250539085fe (diff) | |
download | gcc-95787705db5e014d9ba13ee428bb4d5a2b1f55ee.zip gcc-95787705db5e014d9ba13ee428bb4d5a2b1f55ee.tar.gz gcc-95787705db5e014d9ba13ee428bb4d5a2b1f55ee.tar.bz2 |
re PR go/48501 (64bit-out.go, select5-out.go, tmp.go compilation times out)
PR go/48501
runtime: Fix identity hash function for big-endian systems.
From-SVN: r184218
-rw-r--r-- | libgo/runtime/go-type-identity.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libgo/runtime/go-type-identity.c b/libgo/runtime/go-type-identity.c index a0168e2..142edf4 100644 --- a/libgo/runtime/go-type-identity.c +++ b/libgo/runtime/go-type-identity.c @@ -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; |