Open iamanonymouscs opened 11 months ago
Clang-18 with -mcmodel=tiny -c crashes on the test case. Compiler explorer: https://godbolt.org/z/vvzjxGMjq
$cat mutant.c extern int bar (void *); int foo (void) { return bar ((void *)bar); } $clang-18 -mcmodel=tiny -c mutant.c fatal error: error in backend: Target does not support the tiny CodeModel 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: clang-18 -mcmodel=tiny -c mutant.c 1. <eof> parser at end of file #0 0x00007ff171a1a266 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd2b266) #1 0x00007ff171a18170 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd29170) #2 0x00007ff171a198c4 llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd2a8c4) #3 0x00007ff1719679ae (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xc789ae) #4 0x00007ff17196796b (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xc7896b) #5 0x00007ff171a14a67 llvm::sys::Process::Exit(int, bool) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd25a67) #6 0x0000564ce14c8c23 (/usr/lib/llvm-18/bin/clang+0x13c23) #7 0x00007ff171975c4f llvm::report_fatal_error(llvm::Twine const&, bool) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xc86c4f) #8 0x00007ff171975b26 (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xc86b26) #9 0x00007ff1747b284d (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x3ac384d) #10 0x00007ff1747b4153 (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0x3ac5153) #11 0x00007ff17a1fc993 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>>) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1add993) #12 0x00007ff17a5935fe (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e745fe) #13 0x00007ff1791af866 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0xa90866) #14 0x00007ff17b007645 clang::FrontendAction::Execute() (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x28e8645) #15 0x00007ff17af85cc4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x2866cc4) #16 0x00007ff17b0821c0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x29631c0) #17 0x0000564ce14c8837 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-18/bin/clang+0x13837) #18 0x0000564ce14c5905 (/usr/lib/llvm-18/bin/clang+0x10905) #19 0x00007ff17ac1d909 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x24fe909) #20 0x00007ff17196794c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xc7894c) #21 0x00007ff17ac1d2ae clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x24fe2ae) #22 0x00007ff17abe50f1 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x24c60f1) #23 0x00007ff17abe533e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x24c633e) #24 0x00007ff17ac0139c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x24e239c) #25 0x0000564ce14c525c clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-18/bin/clang+0x1025c) #26 0x0000564ce14d2f32 main (/usr/lib/llvm-18/bin/clang+0x1df32) #27 0x00007ff16fefec87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0 #28 0x0000564ce14c21ea _start (/usr/lib/llvm-18/bin/clang+0xd1ea)
@llvm/issue-subscribers-clang-codegen
Author: Anonymous (iamanonymouscs)
Clang-18 with -mcmodel=tiny -c crashes on the test case. Compiler explorer: https://godbolt.org/z/vvzjxGMjq