Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: unneeded bounds checks #34816

Open
mariecurried opened this issue Oct 10, 2019 · 0 comments
Open

cmd/compile: unneeded bounds checks #34816

mariecurried opened this issue Oct 10, 2019 · 0 comments
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

Comments

@mariecurried
Copy link

mariecurried commented Oct 10, 2019

What version of Go are you using (go version)?

$ go version
go version devel +2197321 Tue Oct 8 23:53:55 2019 +0000 linux/amd64

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.

@agnivade agnivade added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance labels Oct 10, 2019
@ALTree ALTree added this to the Unplanned milestone Dec 4, 2019
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants