-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.arch-armIssues solely affecting the 32-bit arm architecture.Issues solely affecting the 32-bit arm architecture.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.release-blocker
Milestone
Description
Go version
go version devel go1.22-f2d243db8f Wed Dec 13 16:20:09 2023 +0000 linux/amd64
What operating system and processor architecture are you using (go env
)?
linux/arm
What did you do?
NB: filing this issue on behalf of Jan Mercl, who discovered and reported the problem here
Run this program on a GOOS=linux GOARCH=arm machine:
package main
func boolInt32(b bool) int32 {
if b {
return 1
}
return 0
}
func f(left uint16, right int32) (r uint16) {
return left >> right
}
var n = uint16(65535)
func main() {
println(f(n, boolInt32(int64(n^n) > 1)))
}
What did you expect to see?
Expected:
$ go run prog.go
65535
$
What did you see instead?
Got instead:
$ go run prog.go
0
$
Also worth noting that building with -gcflags="-l -N"
makes the problem go away.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.arch-armIssues solely affecting the 32-bit arm architecture.Issues solely affecting the 32-bit arm architecture.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.release-blocker
Type
Projects
Status
Done