-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: unable to compile a program on arm64 with 1.8 that compiles/runs fine on 1.7.5 #19137
Comments
cc @cherrymui |
This error is happening on our systems too: https://travis-ci.org/ethereum/go-ethereum/jobs/202566418#L2526 Note, previously we used Go 1.8 RC3 and that worked flawlessly. |
Here's a repro for Ethereum on Ubuntu. It needs ARM64 C compilers so it may be a bit more involved, but figured a proper bug report should have the repro nontheless. First up if you don't have the C compilers, install them:
The you can check out the source and watch it fail:
|
I think I know what's the problem, at least for the original post. It's Zero/Move lowering to unaligned stores. Will send a fix. |
No, the Zero/Move rules are ok. It is the folding rules that have bad interaction with them. |
CL https://golang.org/cl/37145 mentions this issue. |
With CL https://go-review.googlesource.com/c/37145/, @jolan's code can be built successfully. |
Thanks! Will try in a few hours.
…On Feb 17, 2017 17:53, "cherrymui" ***@***.***> wrote:
With CL https://go-review.googlesource.com/c/37145/, @jolan
<https://github.com/jolan>'s code can be built successfully.
@karalabe <https://github.com/karalabe>, could you try the patch? Right
now I don't have a C cross-compiler on hand.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19137 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAH6GY4fstzJF8-HIzKRf68KeP4WGy8yks5rdcJtgaJpZM4MD5ND>
.
|
reopen for cherry-pick to Go 1.8 release branch. |
CL https://golang.org/cl/37214 mentions this issue. |
@cherrymui I cherry picked https://go-review.googlesource.com/37145 on top of the Go 1.8 release, rebuilt and tried compiling my code. It still fails with the exact same errors as reported in my posts above. |
@cherrymui Hey, so we've merged in a commit to allow building our code (at least this failing part) without CGO too, relying on a fallback package. It still exhibits the same error so you can try it without a C compiler too.
|
@karalabe thanks. Yeah, I found the problem. It's a different problem. Will have a fix later today. |
CL https://golang.org/cl/37251 mentions this issue. |
reopen for fixing Go 1.8. |
…ess into load/store on ARM64 The rules for folding addresses into load/stores checks sym1 is not on stack (because the stack offset is not known at that point). But sym1 could be nil, which invalidates the check. Check merged sym instead. Fixes #19137. Change-Id: I8574da22ced1216bb5850403d8f08ec60a8d1005 Reviewed-on: https://go-review.googlesource.com/37145 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> (cherry picked from commit 3557d54) Reviewed-on: https://go-review.googlesource.com/37214
CL https://golang.org/cl/37719 mentions this issue. |
…e for args on ARM64 Args may be not at 8-byte aligned offset to SP. When the stack frame is large, folding the offset of args may cause large unaligned offsets that does not fit in a machine instruction on ARM64. Therefore disable folding offsets for args. This has small performance impact (see below). A better fix would be letting the assembler backend fix up the offset by loading it into a register if it doesn't fit into an instruction. And the compiler can simply generate large load/stores with offset. Since in most of the cases the offset is aligned or the stack frame is small, it can fit in an instruction and no fixup is needed. But this is too complicated for Go 1.8. name old time/op new time/op delta BinaryTree17-8 8.30s ± 0% 8.31s ± 0% ~ (p=0.579 n=10+10) Fannkuch11-8 6.14s ± 0% 6.18s ± 0% +0.53% (p=0.000 n=9+10) FmtFprintfEmpty-8 117ns ± 0% 117ns ± 0% ~ (all equal) FmtFprintfString-8 196ns ± 0% 197ns ± 0% +0.72% (p=0.000 n=10+10) FmtFprintfInt-8 204ns ± 0% 205ns ± 0% +0.49% (p=0.000 n=9+10) FmtFprintfIntInt-8 302ns ± 0% 307ns ± 1% +1.46% (p=0.000 n=10+10) FmtFprintfPrefixedInt-8 329ns ± 2% 326ns ± 0% ~ (p=0.083 n=10+10) FmtFprintfFloat-8 540ns ± 0% 542ns ± 0% +0.46% (p=0.000 n=8+7) FmtManyArgs-8 1.20µs ± 1% 1.19µs ± 1% -1.02% (p=0.000 n=10+10) GobDecode-8 17.3ms ± 1% 17.8ms ± 0% +2.75% (p=0.000 n=10+7) GobEncode-8 15.3ms ± 1% 15.4ms ± 0% +0.57% (p=0.004 n=9+10) Gzip-8 789ms ± 0% 803ms ± 0% +1.78% (p=0.000 n=9+10) Gunzip-8 128ms ± 0% 130ms ± 0% +1.73% (p=0.000 n=10+9) HTTPClientServer-8 202µs ± 6% 201µs ±10% ~ (p=0.739 n=10+10) JSONEncode-8 42.0ms ± 0% 42.1ms ± 0% +0.19% (p=0.028 n=10+9) JSONDecode-8 159ms ± 0% 161ms ± 0% +1.05% (p=0.000 n=9+10) Mandelbrot200-8 10.1ms ± 0% 10.1ms ± 0% -0.07% (p=0.000 n=10+9) GoParse-8 8.46ms ± 1% 8.61ms ± 1% +1.77% (p=0.000 n=10+10) RegexpMatchEasy0_32-8 227ns ± 1% 226ns ± 0% -0.35% (p=0.001 n=10+9) RegexpMatchEasy0_1K-8 1.63µs ± 0% 1.63µs ± 0% -0.13% (p=0.000 n=10+9) RegexpMatchEasy1_32-8 250ns ± 0% 249ns ± 0% -0.40% (p=0.001 n=8+9) RegexpMatchEasy1_1K-8 2.07µs ± 0% 2.08µs ± 0% +0.05% (p=0.027 n=9+9) RegexpMatchMedium_32-8 350ns ± 0% 350ns ± 0% ~ (p=0.412 n=9+8) RegexpMatchMedium_1K-8 104µs ± 0% 104µs ± 0% +0.31% (p=0.000 n=10+7) RegexpMatchHard_32-8 5.82µs ± 0% 5.82µs ± 0% ~ (p=0.937 n=9+9) RegexpMatchHard_1K-8 176µs ± 0% 176µs ± 0% +0.03% (p=0.000 n=9+8) Revcomp-8 1.36s ± 1% 1.37s ± 1% ~ (p=0.218 n=10+10) Template-8 151ms ± 1% 156ms ± 1% +3.21% (p=0.000 n=10+10) TimeParse-8 737ns ± 0% 758ns ± 2% +2.74% (p=0.000 n=10+10) TimeFormat-8 801ns ± 2% 789ns ± 1% -1.51% (p=0.000 n=10+10) [Geo mean] 142µs 143µs +0.50% Fixes #19137. Change-Id: Ib8a21ea98c0ffb2d282a586535b213cc163e1b67 Reviewed-on: https://go-review.googlesource.com/37251 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> (cherry picked from commit 6464e5d) Reviewed-on: https://go-review.googlesource.com/37719 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
I'm pretty sure this is fixed on the release branch now. @cherrymui, please reopen if I misunderstood the cherry-picks. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8 linux/arm64
What operating system and processor architecture are you using (
go env
)?GOARCH="arm64"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jolan/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_arm64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build063485784=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
What did you expect to see?
No compile errors (works with go 1.7.5)
What did you see instead?
The text was updated successfully, but these errors were encountered: