-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Copy link
Labels
Description
The DeadArgumentElimination pass creates code which fails the IR verifier when run on this input:
%struct.S = type { i32 }
define internal %struct.S @F38() {
ret %struct.S { i32 0 }
}
define %struct.S @F36() {
%3 = musttail call %struct.S @F38()
ret %struct.S %3
}$ /work/llvm/build/bin/opt test.ll -passes=deadargelim -S
cannot guarantee tail call due to mismatched return types
%1 = musttail call i32 @F38()
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /work/llvm/build/bin/opt test.ll -passes=deadargelim -S
1. Running pass "verify" on module "test.ll"
#0 0x000055c16a99ca37 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/work/llvm/build/bin/opt+0x4133a37)
#1 0x000055c16a99a57e llvm::sys::RunSignalHandlers() (/work/llvm/build/bin/opt+0x413157e)
#2 0x000055c16a99d27a SignalHandler(int) Signals.cpp:0:0
#3 0x00007f38e3a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f38e3a969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007f38e3a969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x00007f38e3a969fc pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x00007f38e3a42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007f38e3a287f3 abort ./stdlib/abort.c:81:7
#9 0x000055c16a9857a3 llvm::report_fatal_error(llvm::Twine const&, bool) (/work/llvm/build/bin/opt+0x411c7a3)
#10 0x000055c16a9855f6 (/work/llvm/build/bin/opt+0x411c5f6)
#11 0x000055c16afe2d4a (/work/llvm/build/bin/opt+0x4779d4a)
#12 0x000055c16bd1b53d llvm::detail::PassModel<llvm::Module, llvm::VerifierPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) NewPMDriver.cpp:0:0
#13 0x000055c16abad88a llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/work/llvm/build/bin/opt+0x434488a)
#14 0x000055c16bd146eb 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) (/work/llvm/build/bin/opt+0x54ab6eb)
#15 0x000055c16a964609 optMain (/work/llvm/build/bin/opt+0x40fb609)
#16 0x00007f38e3a29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#17 0x00007f38e3a29e40 call_init ./csu/../csu/libc-start.c:128:20
#18 0x00007f38e3a29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#19 0x000055c16a95e0a5 _start (/work/llvm/build/bin/opt+0x40f50a5)
fish: Job 1, '/work/llvm/build/bin/opt test.l…' terminated by signal SIGABRT (Abort)
Found using a fuzzer while testing #102896.