-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker
Milestone
Description
package main
//go:noinline
func f(x, y uint64) uint64 {
s := "\x04"
c := s[0]
return x<<c<<4
}
func main() {
println(f(1, 1))
}
Should print 256 (0x100), instead prints 1099511628032 (0x10000000100) on arm.
The problem is we build a SLLconst
with a shift amount > 32. That in itself is ok, but we then copy the shift amount into a ORshiftLL
, where the top bits are magically discarded.
The SLL
with a large constant shift amount comes from the 64->32 bit lowering of shifts. We compute things like s-32
and 32-s
(unsigned) for shift amounts in [0,63).
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker