cmd/compile: inlined messaging is unclear when inlining functions from other packages #37704
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.
Milestone
(latest)
What did you do?
main.go
go build -gcflags='-m' main.go
vs
go build -gcflags='-m -l' main.go
What did you expect to see?
Nothing moved to heap for both.
What did you see instead?
The inlined version moved an allocation to heap while the non-inlined version did not.
The relevant part of -gcflags="-m -m":
It appears the const that's passed-in becomes non-const or isn't realized to be const because of the passed-in indirection. The inlining part of the output:
The text was updated successfully, but these errors were encountered: