cmd/compile: uint32(float32(-1)) returns 0 when crosscompiled for arm #57837
Labels
arch-arm
Issues solely affecting the 32-bit arm architecture.
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes the issue can be reproduced with 1.19.5 as well as go1.18.1 where I first encountered it.
What operating system and processor architecture are you using (
go env
)?My host system used for crosscompiling:
go env
OutputI currently don't have go installed on the Raspi, so no
go env
output there.It's a Pi 3, so BCM2837 (
armv7l
) running a 32bit linux.What did you do?
I cross compiled the program below using
GOOS=linux GOARCH=arm GOARM=7 go build -o f32test main.go
and ran it on a raspberry pi.What did you expect to see?
I expected to see an output consistent with the one on my amd64 system:
What did you see instead?
The output on the raspberry pi is:
Comments
I did also check the language specs.
The section on numeric types in the language spec states, that float32 and int32, and uint32 are predeclared architecture-independent numeric types, so I’d expect their behavior to be the same across different architectures.
Also the section on conversions does not mention any undefined or architecture specific behaviour.
Let me know if you need any further information.
The text was updated successfully, but these errors were encountered: