/ go Public
cmd/compile: avoid unnecessary calls to runtime.panicIndex #37740
Issues related to the Go compiler and/or runtime.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using?
go version go1.14 windows/amd64
What did you do?
What did you expect to see?
The generated machine code contains zero calls to
runtime.panicIndexsince all index calculations are safe, and this can be proven easily.
As a bonus, the code generator should recognize that the pattern
parts[n - x]appears repeatedly with varying small constants for
x. There is no need to calculate the expression
16 * nrepeatedly in lines 30 to 33.
What did you see instead?
go tool objdump -s joinCambridgecontains 7 calls to
The text was updated successfully, but these errors were encountered: