Skip to content

crashes with assertion failure when running opt -passes=coro-early #156652

@k-arrows

Description

@k-arrows

Run opt with -passes=coro-early

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

Backtrace:

opt: /root/llvm-project/llvm/lib/Transforms/Coroutines/CoroEarly.cpp:239: void {anonymous}::Lowerer::lowerEarlyIntrinsics(llvm::Function&): Assertion `F.isPresplitCoroutine() && "The frontend uses Switch-Resumed ABI should emit " "\"presplitcoroutine\" attribute for the coroutine."' 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-early <source>
1.	Running pass "coro-early" on module "<source>"
 #0 0x000000000578f178 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x578f178)
 #1 0x000000000578c024 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007a732fa42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007a732fa969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007a732fa42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007a732fa287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007a732fa2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007a732fa39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000002f1e634 (anonymous namespace)::Lowerer::lowerEarlyIntrinsics(llvm::Function&) CoroEarly.cpp:0:0
 #9 0x0000000002f1e85f llvm::CoroEarlyPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2f1e85f)
#10 0x0000000002e23f6e llvm::detail::PassModel<llvm::Module, llvm::CoroEarlyPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2e23f6e)
#11 0x0000000005578c41 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5578c41)
#12 0x0000000000976da8 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+0x976da8)
#13 0x000000000096ae17 optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x96ae17)
#14 0x00007a732fa29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#15 0x00007a732fa29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#16 0x0000000000961f35 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x961f35)
Program terminated with signal: SIGSEGV
Compiler returned: 139

Metadata

Metadata

Assignees

No one assigned

    Labels

    coroutinesC++20 coroutinescrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions