Open llvmbot opened 6 years ago
Still crashing as of post-16 trunk: https://godbolt.org/z/rGKxd1c1n
clang++: /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1550:
llvm::SDValue llvm::SelectionDAG::getConstant(uint64_t, const llvm::SDLoc&, llvm::EVT, bool, bool):
Assertion `(EltVT.getSizeInBits() >= 64 || (uint64_t)((int64_t)Val >> EltVT.getSizeInBits()) + 1 < 2) && "getConstant with a uint64_t value that doesn't fit in the type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -m32 -O3 -x c <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@fn1'
#0 0x00005632cd89ac1a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a9ac1a)
#1 0x00005632cd89884c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a9884c)
#2 0x00005632cd7e7020 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f3c8979e420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f3c8926b00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f3c8924a859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f3c8924a729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f3c8925bfd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x00005632ce7f1293 llvm::SelectionDAG::getConstant(unsigned long, llvm::SDLoc const&, llvm::EVT, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49f1293)
#9 0x00005632ce79cfd6 llvm::SelectionDAGBuilder::visitGetElementPtr(llvm::User const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x499cfd6)
#10 0x00005632ce7ac9f1 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49ac9f1)
#11 0x00005632ce824551 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, bool&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4a24551)
#12 0x00005632ce825abe llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4a25abe)
#13 0x00005632ce8276bc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.1114) SelectionDAGISel.cpp:0:0
#14 0x00005632cc5a1215 (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) X86ISelDAGToDAG.cpp:0:0
#15 0x00005632ccd015a0 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.72) MachineFunctionPass.cpp:0:0
#16 0x00005632cd27d7de llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x347d7de)
#17 0x00005632cd27db19 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x347db19)
#18 0x00005632cd27e920 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x347e920)
#19 0x00005632cdadae2b clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3cdae2b)
#20 0x00005632ce968753 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4b68753)
#21 0x00005632cfc3a459 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e3a459)
#22 0x00005632ce967560 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4b67560)
#23 0x00005632ce2892e9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x44892e9)
#24 0x00005632ce21dc42 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x441dc42)
#25 0x00005632ce360c9f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4560c9f)
#26 0x00005632cb022cc3 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1222cc3)
#27 0x00005632cb01ade8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#28 0x00005632ce0912f9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#29 0x00005632cd7e74a5 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x39e74a5)
#30 0x00005632ce093eee clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4293eee)
#31 0x00005632ce06060b clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x426060b)
#32 0x00005632ce0611e3 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42611e3)
#33 0x00005632ce069fd6 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4269fd6)
#34 0x00005632cb020a8e clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1220a8e)
#35 0x00005632caf51cb1 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1151cb1)
#36 0x00007f3c8924c083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#37 0x00005632cb01a4da _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x121a4da)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
I wonder if this is almost a duplicate of: https://github.com/llvm/llvm-project/issues/72503
Since if we diagnosed this earlier then we would not get to codegen
Extended Description
$ cat abc.c