cmd/compile: BCE optimizes less for string than slice #27585
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
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
yes
What did you do?
What did you expect to see?
For
T
is eitherstring
or[]int
, the bounds check fory[i]
at line 25 should be eliminated.But this is only true for
T
is[]int
.What did you see instead?
When
T
isstring
, the bounds check for y[i] at line 25 is still needed.The text was updated successfully, but these errors were encountered: