cmd/compile: unnecessary array copying in for range loop #33838
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
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 program and analyzed the assembly code generated (https://godbolt.org/z/QXblVs):
What did you expect to see?
I expected the looping part of this function to not contain unnecessary instructions, like in (https://godbolt.org/z/L3hIuW):
What did you see instead?
Instead, it was compiled to all this instructions, most of which are unnecessary (https://godbolt.org/z/QXblVs):
Note: There are probably open issues about this, but I couldn't find any.
The text was updated successfully, but these errors were encountered: