Skip to content

cmd/compile: unnecessary bounds check #29872

@mariecurried

Description

@mariecurried

What did you do?

I compiled the following program to see its assembly code: https://godbolt.org/z/OcRvPE

What did you expect to see?

I expected the access to the slice to not be bounds checked

What did you see instead?

A bounds check was generated by the Go compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancehelp wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions