cmd/compile: defer wrapper has more instructions than hand-written wrapper #49656
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
defer src.Close()
results in surprisingly more assembly thandefer func() { _ = src.Close()}()
. Is this a bug or am I missing something?https://godbolt.org/z/KP4q1WTah
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?
Inspect the assembly generated from an implicitly swallowed error
vs doing it explicitly like this:
The text was updated successfully, but these errors were encountered: