New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: incorrect inlining of function swapping two funcs #59108
Comments
According to the decompilation at https://godbolt.org/z/hacWM8Ejd The bug is introduced with 1.16, 1.15 still has both functions, starting with 1.16 to 1.19 the inlined b function is optimized away. |
Fixed for Go1.20 here: #54632 |
Duplicate of #54632 |
Curious: Is a fix for Go 1.19.x planned? |
@gopherbot Please open backport issue for 1.19 Reportedly this issue occurs in 1.19 as well. |
Backport issue(s) opened: #59158 (for 1.19). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It does with 1.19; not with 1.20.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
See test in playground.
By uncommenting the commented-out line in
test()
(introducing two blank variables) you can get the test to pass, presumably by preventing inlining.What did you expect to see?
Output "01", indicating first the first, then the second func getting called.
What did you see instead?
Output "00", indicating the first func instead got called twice.
The text was updated successfully, but these errors were encountered: