cmd/compile: elide unnecessary copies #54613
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
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, reproduces on Go 1.19.
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
What did you expect to see?
Both functions to compile the same.
What did you see instead?
fn2
really does copyarr
4 times. The compiler could elide these copies, turning arr2–5 into aliases, without affecting the behavior of the program.The text was updated successfully, but these errors were encountered: