-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Using gnu_asm_goto_with_outputs_full without optimizations returns uninitialized memory #60855
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
Comments
@nickdesaulniers asked me to assign this issue to him, but it looks like I don't have permission to do so. |
Thanks for the report. IIUC, It looks like Specifically, we're missing a store in the indirect edges, so we're loading uninitialized stack slots. |
This test demonstrates an issue with callbr outputs being used along indirect edges when using regallocfast. Link: #60855 Differential Revision: https://reviews.llvm.org/D144906
Thanks again for the report @josephcsible , please keep hammering! |
Consider this C code:
It's supposed to return 45. But when compiled on Clang trunk (4be1764) without optimizations, it produces this assembly:
Which ends up returning uninitialized memory (the
-16(%rbp)
from the third-to-last line) instead. If I instead compile with any optimization level (other than-O0
), then it produces correct assembly.https://godbolt.org/z/fnPcYY44G
The text was updated successfully, but these errors were encountered: