Issue 157233
Summary crashes with assertion failure when running opt -passes=coro-elide
Labels crash, coroutines
Assignees
Reporter k-arrows
    Run opt with -passes=coro-elide

Reproducer:
https://godbolt.org/z/zoE4dnqMY

Backtrace:
```console
opt: /root/llvm-project/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From*) [with To = llvm::Function; From = llvm::Value]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=coro-elide <source>
1.	Running pass "function(coro-elide)" on module "<source>"
2.	Running pass "coro-elide" on function "test_chr_with_coro_id"
 #0 0x000000000579f788 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x579f788)
 #1 0x000000000579c634 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007f5830842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f58308969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007f5830842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007f58308287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007f583082871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007f5830839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000002f25bc4 (anonymous namespace)::FunctionElideInfo::collectPostSplitCoroIds() CoroElide.cpp:0:0
 #9 0x0000000002f27d8c llvm::CoroElidePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2f27d8c)
#10 0x0000000002e2ad8e llvm::detail::PassModel<llvm::Function, llvm::CoroElidePass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2e2ad8e)
#11 0x000000000558b421 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x558b421)
#12 0x0000000000ee035e llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xee035e)
#13 0x000000000558998a llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x558998a)
#14 0x000000000096cd3e llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x96cd3e)
#15 0x0000000005589341 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5589341)
#16 0x0000000000977038 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x977038)
#17 0x000000000096b0a7 optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x96b0a7)
#18 0x00007f5830829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#19 0x00007f5830829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#20 0x00000000009621c5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x9621c5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to