libgo patch committed: Update to Go1.17rc2 release

H.J. Lu hjl.tools@gmail.com
Tue Aug 31 13:24:32 GMT 2021


On Thu, Aug 12, 2021 at 8:24 PM Ian Lance Taylor via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> This patch updates libgo from the Go1.16.5 release to the Go 1.17rc2
> release.  As usual with these version updates, the patch itself is too
> large to attach to this e-mail message.  I've attached the changes to
> files that are specific to gccgo.  Bootstraped and ran Go testsuite on
> x86_64-pc-linux-gnu.  Committed to mainline.
>
> Ian

This breaks build with x32:

/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:35:30:
error: integer constant overflow
   35 |         seed ^= hashkey[0] ^ m1
      |                              ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:61:50:
error: integer constant overflow
   61 |                                 seed = mix(r8(p)^m2, r8(add(p, 8))^seed)
      |                                                  ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:62:60:
error: integer constant overflow
   62 |                                 seed1 = mix(r8(add(p, 16))^m3,
r8(add(p, 24))^seed1)
      |                                                            ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:63:60:
error: integer constant overflow
   63 |                                 seed2 = mix(r8(add(p, 32))^m4,
r8(add(p, 40))^seed2)
      |                                                            ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:69:42:
error: integer constant overflow
   69 |                         seed = mix(r8(p)^m2, r8(add(p, 8))^seed)
      |                                          ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:76:20:
error: integer constant overflow
   76 |         return mix(m5^s, mix(a^m2, b^seed))
      |                    ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:76:32:
error: integer constant overflow
   76 |         return mix(m5^s, mix(a^m2, b^seed))
      |                                ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:81:22:
error: integer constant overflow
   81 |         return mix(m5^4, mix(a^m2, a^seed^hashkey[0]^m1))
      |                      ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:81:32:
error: integer constant overflow
   81 |         return mix(m5^4, mix(a^m2, a^seed^hashkey[0]^m1))
      |                                ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:81:54:
error: integer constant overflow
   81 |         return mix(m5^4, mix(a^m2, a^seed^hashkey[0]^m1))

The problem is that hashkey is an array of uintptr, but hash64.go is enabled for
many targets with 32-bit uintptr:

commit c5b21c3f4c17b0649155035d2f9aa97b2da8a813
Author: Ian Lance Taylor <iant@golang.org>
Date:   Fri Jul 30 14:28:58 2021 -0700

    libgo: update to Go1.17rc2

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629

diff --git a/libgo/go/runtime/hash64.go b/libgo/go/runtime/hash64.go
index 704bbe6f62b..4b32d515c4b 100644
--- a/libgo/go/runtime/hash64.go
+++ b/libgo/go/runtime/hash64.go
@@ -3,113 +3,98 @@
 // license that can be found in the LICENSE file.

 // Hashing algorithm inspired by
-//   xxhash: https://code.google.com/p/xxhash/
-// cityhash: https://code.google.com/p/cityhash/
+// wyhash: https://github.com/wangyi-fudan/wyhash

+//go:build amd64 || arm64 || mips64 || mips64le || ppc64 || ppc64le
|| riscv64 || s390x || wasm || alpha || amd64p32 || arm64be || ia64 ||
mips64p32 || mips64p32le || sparc64
 // +build amd64 arm64 mips64 mips64le ppc64 ppc64le riscv64 s390x
wasm alpha amd64p32 arm64be ia64 mips64p32 mips64p32le sparc64


-- 
H.J.


More information about the Gcc-patches mailing list