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
aarch64 middle-end optimizer bug: crash when use &&labels(1) #54238
Comments
define i32 @main() {
call void @set_return_addr(i64* bitcast (i8* blockaddress(@main, %redirected) to i64*))
ret i32 0
redirected:
ret i32 0
}
define internal void @set_return_addr(i64* %addr) {
%addr.addr = alloca i64*, i32 0, align 8
store i64* %addr, i64** %addr.addr, align 8
ret void
} Crashes the verifier after cc @nickdesaulniers who tends to know stuff about blockaddress. |
And @ashimida123 is implementing Shadow Call Stack (SCS) in GCC for use in the linux kernel. :) Hi @ashimida123 , thank you for filing the report (and #54251). Given the test cases, I can definitely reproduce a crash w/ ToT. IIUC, it looks like the @efriedma-quic explains here that I think we should not consider a |
Using address of labels for comparisons is unspecified behavior. |
Hi, @nickdesaulniers , nice to see you here :)
Yeah, combined with your comment in #54328 , it makes sense to me. |
[SCCP] do not clean up dead blocks that have their address taken Fixes a crash observed in IPSCCP. Because the SCCPSolver has already internalized BlockAddresses as Constants or ConstantExprs, we don't want to try to update their Values in the ValueLatticeElement. Instead, continue to propagate these BlockAddress Constants, continue converting BasicBlocks to unreachable, but don't delete the "dead" BasicBlocks which happen to have their address taken. Leave replacing the BlockAddresses to another pass. Fixes: #54238 Fixes: #54251 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D121744
[SCCP] do not clean up dead blocks that have their address taken Fixes a crash observed in IPSCCP. Because the SCCPSolver has already internalized BlockAddresses as Constants or ConstantExprs, we don't want to try to update their Values in the ValueLatticeElement. Instead, continue to propagate these BlockAddress Constants, continue converting BasicBlocks to unreachable, but don't delete the "dead" BasicBlocks which happen to have their address taken. Leave replacing the BlockAddresses to another pass. Fixes: llvm/llvm-project#54238 Fixes: llvm/llvm-project#54251 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D121744
Code in use:
main-0a64b0.zip
The text was updated successfully, but these errors were encountered: