-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
asm goto miscompilation #74483
Comments
I think the issue is introduced during regallocfast (hence it only being reproducible at
That |
@nickdesaulniers It looks like this miscompilation affects release build as well.
which is fine-ish since it affected debug build only. But if I enable this work-around in release mode, it will slow down the hottest code. |
As far as I understand
asm goto
now supports output arguments on all paths. If I am reading this correctly, in this caseasm goto
corrupts local state (output variable has incorrect value). The code is:With
-O3
the program correctly prints 11:https://godbolt.org/z/x17GnP4nK
But with
-O0
it prints 0:https://godbolt.org/z/h7MM9YTfP
The generated code is:
If we track the
x
variable, it's spilled to-80(%rbp)
, but then loaded from-32(%rbp)
:The text was updated successfully, but these errors were encountered: