-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
llvm/include/llvm/Support/Casting.h:109: Assertion failed #93029
Comments
@llvm/issue-subscribers-c Author: None (dcb314)
Clang can be made to say:
clang: /home/dcb38/llvm/trunk/llvm/include/llvm/Support/Casting.h:109: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::UndefValue; From = llvm::Constant]: Assertion `Val && "isa<> used on a null pointer"' failed. codegen_timing_486-53904b.sh.gz |
Can't reproduce on trunk and 18.1.0 with assertions: https://godbolt.org/z/8Wxvqcz4o |
The version of the compiler I used was from this morning. Stack backtrace is
Machine type is x86_64. AMD Zen 3 I think. When the reduction is finished, I will post it here. |
Thank you for reducing it yourself! Please make sure you follow this guidance, in order for your reduction to be as useful as possible: #89807 (comment) |
It works fine with yesterday's clang: llvm $ ~/llvm/results.20240521/bin/clang -c -w -O1 codegen_timing_486-53904b.c
llvm $ But not todays ;-| llvm $ ~/llvm/results.20240522/bin/clang -c -w -O1 codegen_timing_486-53904b.c
lang: /home/dcb38/llvm/trunk/llvm/include/llvm/Support/Casting.h:109: static bo
ol llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::UndefV
alue; From = llvm::Constant]: Assertion `Val && "isa<> used on a null pointer"'
failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and i
nclude the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /home/dcb38/llvm/results.20240522/bin/clang -c -w -O1
codegen_timing_486-53904b.c
1. <eof> parser at end of file
2. Optimizer
#0 0x0000000001fa377e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home
/dcb38/llvm/trunk/llvm/lib/Support/Unix/Signals.inc:723:22
#1 0x0000000001fa08eb llvm::sys::RunSignalHandlers() /home/dcb38/llvm/trunk/llv
m/lib/Support/Signals.cpp:105:20
#2 0x0000000001eed398 HandleCrash /home/dcb38/llvm/trunk/llvm/lib/Support/Crash
RecoveryContext.cpp:73:5
#3 0x0000000001eed398 CrashRecoverySignalHandler(int) /home/dcb38/llvm/trunk/ll
vm/lib/Support/CrashRecoveryContext.cpp:390:62
#4 0x00007fbec565fbb0 __restore_rt (/lib64/libc.so.6+0x3dbb0)
#5 0x00007fbec56b0884 __pthread_kill_implementation (/lib64/libc.so.6+0x8e884)
#6 0x00007fbec565fafe gsignal (/lib64/libc.so.6+0x3dafe)
#7 0x00007fbec564887f abort (/lib64/libc.so.6+0x2687f)
#8 0x00007fbec564879b _nl_load_domain.cold (/lib64/libc.so.6+0x2679b)
#9 0x00007fbec5658187 (/lib64/libc.so.6+0x36187)
#10 0x0000000001b7cfe4 llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(llvm
::LoadInst*, llvm::GetElementPtrInst*, llvm::GlobalVariable*, llvm::CmpInst&, ll Yesterday's compiler has git hash 6246b49 That looks like 142 commits, so that should be easy (for someone who knows |
Reproducer: https://godbolt.org/z/c1oT7cncd
LLVM version: cf12830 |
Final reduced C code seems to be: int timing_int;
static int *opcode_timings[] = {&timing_int, 0};
char codegen_timing_486_prefix_prefix;
void codegen_timing_486_prefix() {
if ((long)opcode_timings[codegen_timing_486_prefix_prefix] & ~0xffff)
*(int *)0;
} |
Fixed by 0748a98 |
Clang can be made to say:
clang: /home/dcb38/llvm/trunk/llvm/include/llvm/Support/Casting.h:109: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::UndefValue; From = llvm::Constant]: Assertion `Val && "isa<> used on a null pointer"' failed.
codegen_timing_486-53904b.sh.gz
codegen_timing_486-53904b.c.gz
The text was updated successfully, but these errors were encountered: