Closed
Description
What version of Go are you using (go version
)?
go version go1.11.2 linux/amd64
Does this issue reproduce with the latest release?
YES
What operating system and processor architecture are you using (go env
)?
go env
Output
GOARCH="amd64" GOBIN="" GOCACHE="/home/fred/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/fred/workspace/go" GOPROXY="" GORACE="" GOROOT="/usr/lib/go" GOTMPDIR="" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build795351668=/tmp/go-build -gno-record-gcc-switches"
package mainimport (
"fmt"
)func main() {
id := 1
a := float32(2.0)
b := float32(5.0)
testOut(id, a*b)
}func testOut(id int, a float32) {
fmt.Println(id, a)
}$ env GOOS=linux GOARCH=arm go build -o test.arm7 main.go
running on raspberry pi 3 Model:B V:2
Linux PiOne 4.14.79-1-ARCH #1 SMP Tue Nov 6 03:01:46 UTC 2018 armv7l GNU/Linux$ ./test.arm7
What did you expect to see?
1 10
What did you see instead?
1073741824 10
When I do the multiplication outside the function call testOut() I get output (1 10).
Only happens when I do cross compilation.
When I cross compile and set GOARM=7, it works just fine.
env GOOS=linux GOARCH=arm GOARM=7 go build -o test.arm7 main.go
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
mvdan commentedon Nov 9, 2018
@derfbn does this occur with Go 1.10 or previous Go versions?
[-]function call with 2 arguments, inline multiplication corrupts first argument on arm[/-][+]cmd/compile: inline multiplication corrupts an argument on arm[/+]mvdan commentedon Nov 9, 2018
Tentatively marking as a release blocker for 1.12, until we're sure that this isn't important enough.
frbrno commentedon Nov 9, 2018
go version go1.10.5 linux/amd64
go env
Output@mvdan does not occur on Go 1.10.5
ianlancetaylor commentedon Nov 9, 2018
CC @randall77
josharian commentedon Nov 9, 2018
Seems like a backport candidate. Let's wait to see what the diagnosis is.
gopherbot commentedon Nov 9, 2018
Change https://golang.org/cl/148837 mentions this issue:
cmd/compile/internal/gc: OMUL should be evaluated when using soft-float
milanknezevic commentedon Nov 9, 2018
The issue can be reproduced on mips too.
josharian commentedon Nov 9, 2018
@gopherbot please open a backport tracking issue for 1.11. This is a compiler correctness bug.
gopherbot commentedon Nov 9, 2018
Backport issue(s) opened: #28694 (for 1.11).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.
milanknezevic commentedon Nov 13, 2018
@josharian Could this also be backported to 1.10 because it affects mips softfloat support which is added in 1.10?
josharian commentedon Nov 13, 2018
Sure. FYI, anyone can open a backport request.
@gopherbot please also open a backport tracking issue for 1.10. This is a compiler correctness bug.
josharian commentedon Nov 13, 2018
Hmm, gopherbot doesn't seem to be as speedy as I would expect. I wonder whether incrementally adding backport releases isn't well supported right now. @dmitshur?
dmitshur commentedon Nov 13, 2018
@josharian It's not; the tracking issue for that is #25574. Gopherbot already responded to a backport command earlier in this issue, so until #25574 is resolved, it never listens to follow up backport requests.
Until the gopherbot issue is resolved, the suggested workaround is to create a backport issue manually.
gopherbot commentedon Nov 27, 2018
Change https://golang.org/cl/151342 mentions this issue:
[release-branch.go1.11] cmd/compile/internal/gc: OMUL should be evaluated when using soft-float
gopherbot commentedon Nov 27, 2018
Change https://golang.org/cl/151343 mentions this issue:
[release-branch.go1.10] cmd/compile/internal/gc: OMUL should be evaluated when using soft-float
[release-branch.go1.11] cmd/compile/internal/gc: OMUL should be evalu…
go1.11.2 updates tracking (#2)
[release-branch.go1.10] cmd/compile/internal/gc: OMUL should be evalu…
gopherbot commentedon Dec 14, 2018
Change https://golang.org/cl/154297 mentions this issue:
Revert "[release-branch.go1.10] cmd/compile/internal/gc: OMUL should be evaluated when using soft-float"
Revert "[release-branch.go1.10] cmd/compile/internal/gc: OMUL should …