cmd/compile: No BCE for x&(len(p)-1) #57243
Labels
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.
Performance
Milestone
What version of Go are you using (
go version
)?What did you do?
Distilled from a custom hash table:
What did you expect to see?
BCE for the expression p[i]. From the if statement, the compiler knows that len(p) > 0, so len(p)-1 is non-negative and in bounds, and so is h&(len(p)-1).
What did you see instead?
./bce.go:8:10: Found IsInBounds
It doesn't seem to matter if I put the cast on h or change the length check to <=0.
The text was updated successfully, but these errors were encountered: