-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Open
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]llvmUmbrella label for LLVM issuesUmbrella label for LLVM issues
Description
When running opt on the following IR, opt crashes.
I am not sure whether this is a valid case. If using opt in this way is not appropriate, I am open to closing this issue.
godbolt: https://godbolt.org/z/j5rj3q4W5
llvm version 50ae726
test.ll
; Function Attrs: nounwind
define i32 @main() #0 {
entry:
ret i32 0
}
attributes #0 = { nounwind "disable-tail-calls"="disable-freq-sample" }
commads
./bin/opt test.ll -passes=tailcallelim -S
stacktrace
opt: /root/llvm-project/llvm/lib/IR/Attributes.cpp:853: bool llvm::AttributeImpl::getValueAsBool() const: Assertion `getValueAsString().empty() || getValueAsString() == "false" || getValueAsString() == "true"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=tailcallelim -S <source>
1. Running pass "function(tailcallelim)" on module "<source>"
2. Running pass "tailcallelim" on function "main"
#0 0x00000000059afac8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x59afac8)
#1 0x00000000059ac974 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x59ac974)
#2 0x00000000059acaea SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x000078a3f6842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000078a3f68969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000078a3f6842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000078a3f68287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000078a3f682871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x000078a3f6839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x0000000005588795 llvm::AttributeImpl::getValueAsBool() const (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5588795)
#10 0x00000000048c5963 llvm::TailCallElimPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x48c5963)
#11 0x0000000002c9eb5e llvm::detail::PassModel<llvm::Function, llvm::TailCallElimPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2c9eb5e)
#12 0x000000000578ca41 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x578ca41)
#13 0x0000000000f0685e 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+0xf0685e)
#14 0x000000000578b10a llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x578b10a)
#15 0x0000000000972e3e 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+0x972e3e)
#16 0x000000000578aac1 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x578aac1)
#17 0x000000000097d16a 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+0x97d16a)
#18 0x0000000000970fe8 optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x970fe8)
#19 0x000078a3f6829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#20 0x000078a3f6829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#21 0x0000000000967a85 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x967a85)
Program terminated with signal: SIGSEGV
Compiler returned: 139
Metadata
Metadata
Assignees
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]llvmUmbrella label for LLVM issuesUmbrella label for LLVM issues