cmd/compile: functions evaluated in defer and go statements are not checked for inlining #42194
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Compile this source code with
go tool compile -m=2 p.go
:What did you expect to see?
What did you see instead?
I.e., I expect
g
to be inlined, but it is not.Even though
g
is eligible to be inlined, and it is evaluated on line 4 to provide the argument to the deferred call tof
, it is not inlined. The issue appears to be thatinlnode
marks the callee indefer
andgo
statements as ineligible for inlining and then immediately returns, so the arguments to that callee are not checked.I found this during work on #41117.
The text was updated successfully, but these errors were encountered: