<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/73431>73431</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-18 crash: Target does not support the tiny CodeModel.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
iamanonymouscs
</td>
</tr>
</table>
<pre>
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)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8WFuT26jW_TXyC9UuBLo--MFxt2eSSiqpdCoP34sLoS03GQk0gPoyv_4rkBwLt_ukO-NzUqlE5rL3YmmzFogZI_YSYBWl76L0esEGe6f0SrCOSSWfOjUYbhaVqp9Wm5bJ_VVcoAdh79BVxztVQxvRayvkE7riiGtm7sAgJZG9A2TBWMSZgWWEryO83qiuFy1oBI99qzToiK7RnbW9ieg6ItuIbPeqrlRrl0rvI7L9JyLb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