Skip to content
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: global variable initialization done in unexpected order [1.18 backport] #52857

Open
gopherbot opened this issue May 11, 2022 · 2 comments
Labels
CherryPickCandidate
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented May 11, 2022

@mdempsky requested issue #51913 to be considered for backport to the next 1.18 minor release.

@gopherbot Please backport to Go 1.18. This is a silent miscompilation of valid (albeit unlikely) code.

@gopherbot gopherbot added the CherryPickCandidate label May 11, 2022
@gopherbot gopherbot added this to the Go1.18.3 milestone May 11, 2022
@mdempsky
Copy link
Member

@mdempsky mdempsky commented May 11, 2022

The issue is that https://go.dev/play/p/vyyJGI51r2w should pass, but it fails with Go 1.18 (and Go 1.17). It's a somewhat obscure case IMO (gccgo added the same broken optimization to match cmd/compile semantics actually), but it is in fact valid code.

https://go.dev/cl/395541 should backport cleanly and fixes the issue. The other package runtime CLs are not necessary for the fix.

@toothrot
Copy link
Contributor

@toothrot toothrot commented May 25, 2022

@mdempsky Should we open a backport for Go 1.17 as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickCandidate
Projects
None yet
Development

No branches or pull requests

3 participants