cmd/compile: taking address of variables in chain breaks optimizations #33972
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.
What did you do?
I tested the behavior of the gc given a chain of address taking operations (I know these are pretty contrived examples):
What did you expect to see?
I expected functions 1/2 to compile to a simple return of -1 and 3/4 to a return of x.
What did you see instead?
Instead, all the functions contain unnecessary instructions:
mov
through the variablex
mov
through the variablex
and extra nil checkThe text was updated successfully, but these errors were encountered: