-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 wrong output at -O0
#110251
Labels
Comments
Looks like a bug in fast regalloc. CC @nickdesaulniers |
antoniofrighetto
added a commit
to antoniofrighetto/llvm-project
that referenced
this issue
Mar 14, 2025
…pills We have already ensured in 9cec2b2 that `INLINEASM_BR` output operands get spilled onto the stack, both in the fallthrough path and in the indirect targets. Since reloads of live-ins values into physical registers contextually happens after all MIR instructions (and ops) have been visited, make sure such loads are placed at the start of the block, but after prologues or `INLINEASM_BR` spills, as otherwise this may cause stale values to be read from the stack. Fixes: llvm#74483, llvm#110251.
antoniofrighetto
added a commit
to antoniofrighetto/llvm-project
that referenced
this issue
Mar 24, 2025
…pills We have already ensured in 9cec2b2 that `INLINEASM_BR` output operands get spilled onto the stack, both in the fallthrough path and in the indirect targets. Since reloads of live-ins values into physical registers contextually happen after all MIR instructions (and ops) have been visited, make sure such loads are placed at the start of the block, but after prologues or `INLINEASM_BR` spills, as otherwise this may cause stale values to be read from the stack. Fixes: llvm#74483, llvm#110251.
Should be fixed in ade2276, thanks for reporting! |
This was referenced Mar 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Godbolt: https://godbolt.org/z/3a1vYMaoq
The output should be
11
, yet clang at-O0
stores0
to the pointed-to variable.Looks like only the jump branch is buggy, if input is changed to another value and the fall-through path is taken, the output is correct.
Possibily related: #74483
The text was updated successfully, but these errors were encountered: