cmd/compile: ineffective branch caused by defer #32930
Open
Labels
Milestone
Comments
CC @randall77 |
This is known. One return path is the normal return path, and one is the panic/recover return path. Each has a call to deferreturn. We don't share epilogues at the moment, see #24936 for some discussion. In any case, this bug will probably become obsolete once we fix #14939. But I'll leave this open for now. I couldn't find an issue explicitly about epilogue sharing (which this is), so might as well use this one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
I was testing the behavior of
defer
, so I ended up compiling the following functions (https://godbolt.org/z/uALdNA):What did you expect to see?
I expected the generated assembly to not contain any unnecessary branches.
What did you see instead?
Instead, there is a repeated block of instructions that is preceded by a condicional jump (https://godbolt.org/z/uALdNA):
The text was updated successfully, but these errors were encountered: