cmd/compile: unneeded bounds checks #34816
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
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
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
I compiled the following functions to check if there were any bounds checks: https://godbolt.org/z/RSrNwR.
What did you expect to see?
I expected to see no bounds checks.
What did you see instead?
Instead, I see 7 different bounds checks generated by the Go compiler (highlighted in the site above).
I talked with @zdjones about this and it appears like all these bounds checks can be removed.
The text was updated successfully, but these errors were encountered: