cmd/compile: prove bounds for & of positive values #38717
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Compile
go build -gcflags="-d=ssa/check_bce/debug=1"
What did you expect to see?
Just the first bounds check for the initial length of the slice
Because prove should be able to deduce that the masked value is bounded by 63 and so is already in bounds.
r := i&m && m >= 0 --> 0 <= r <= m
What did you see instead?
Both accesses require a bounds check.
This is related to #38476
@rasky @josharian @zdjones
The text was updated successfully, but these errors were encountered: