<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54436>54436</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion failed: Unsupported encoding when using _Fract
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pmor13
</td>
</tr>
</table>
<pre>
This code:
```
#include <stdio.h>
int main(void)
{
_Fract x = 0.5;
printf("r\n", x); // warning: data argument not used by format string [-Wformat-extra-args]
}
```
compiled with `x86-64 clang (assertions trunk)` on Linux 64-bit with `-ffixed-point -O3` leads to:
```
clang: /root/llvm-project/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:229: static bool llvm::DebugHandlerBase::isUnsignedDIType(const llvm::DIType*): Assertion `(Encoding == dwarf::DW_ATE_unsigned || Encoding == dwarf::DW_ATE_unsigned_char || Encoding == dwarf::DW_ATE_signed || Encoding == dwarf::DW_ATE_signed_char || Encoding == dwarf::DW_ATE_float || Encoding == dwarf::DW_ATE_UTF || Encoding == dwarf::DW_ATE_boolean || (Ty->getTag() == dwarf::DW_TAG_unspecified_type && Ty->getName() == "decltype(nullptr)")) && "Unsupported encoding"' 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 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics -ffixed-point -O3 <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'X86 Assembly Printer' on function '@main'
#0 0x00005642cb2d527f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x00005642cb2d3080 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3ad3080)
#2 0x00005642cb208d08 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f82b9b463c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
#4 0x00007f82b961303b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4303b)
#5 0x00007f82b95f2859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f82b95f2729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f82b9604006 (/lib/x86_64-linux-gnu/libc.so.6+0x34006)
#8 0x00005642cbfe4d9e llvm::DebugHandlerBase::isUnsignedDIType(llvm::DIType const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47e4d9e)
#9 0x00005642cc01f705 llvm::DwarfUnit::addConstantValue(llvm::DIE&, unsigned long, llvm::DIType const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x481f705)
#10 0x00005642cc07c243 llvm::DwarfCompileUnit::constructVariableDIEImpl(llvm::DbgVariable const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x487c243)
#11 0x00005642cc080188 llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4880188)
#12 0x00005642cc081c34 llvm::DwarfCompileUnit::constructSubprogramScopeDIE(llvm::DISubprogram const*, llvm::LexicalScope*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4881c34)
#13 0x00005642cc013aa2 llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4813aa2)
#14 0x00005642cbfe22c5 llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47e22c5)
#15 0x00005642cbfdd89c llvm::AsmPrinter::emitFunctionBody() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47dd89c)
#16 0x00005642c9d37e4b llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x2537e4b)
#17 0x00005642ca50b346 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x2d0b346)
#18 0x00005642ca9eb786 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x31eb786)
#19 0x00005642ca9ebad9 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x31ebad9)
#20 0x00005642ca9ec419 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x31ec419)
#21 0x00005642cb61accb clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e1accb)
#22 0x00005642cc32c46b clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b2c46b)
#23 0x00005642cd25fb89 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5a5fb89)
#24 0x00005642cc32afa0 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b2afa0)
#25 0x00005642cbcbef71 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44bef71)
#26 0x00005642cbc593ca clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44593ca)
#27 0x00005642cbd8b163 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x458b163)
#28 0x00005642c8c05ae1 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1405ae1)
#29 0x00005642c8c01979 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#30 0x00005642cbaf85d5 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#31 0x00005642cb2092f3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3a092f3)
#32 0x00005642cbafa966 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::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+0x42fa966)
#33 0x00005642cbacd14a clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x42cd14a)
#34 0x00005642cbacdddf clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x42cdddf)
#35 0x00005642cbad62da clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x42d62da)
#36 0x00005642c8b4a3ef main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x134a3ef)
#37 0x00007f82b95f40b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#38 0x00005642c8c014ea _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x14014ea)
clang-15: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlWk1z2zgS_TXyBUUVv0kdfJBleyZbmY0rdmb2pgIBUOIORXJB0Jb-_XYDpETQcuJklZnDqpRYIoDGew_djSbErOaH66dt0RJWczELljP3duYuZ7Hbv81XPygqVnZckFmwahUv6vl2FtyZ1qJSZEeLauanz3XBZ_6iH5XcmA-kf63vJWWK7MHILXHn0SyYdGgk2MrBzsz35SxagUl_5q_IHm0GN2Tm38ObvFBZFdUG0BJOFSVUbrqdABRVrUjXCk6yA8lruaOKtApsbsgsunH-MJccsVeSOjConUW3A9Tbs8RZvWuKEgy-FGpL4PI-jZ04JKykaNRPadsKqYq6aomSXfUnAo1dUlfkY1F1exKHTlao43Anz4u94E5To2jOpwA7l4JyGF6_pb6eDMkCd1nXCv6U5fPOaWT9b8GGr_inyOD_FSzkLwKku1-2uwdUVEj4ciuybvMrrXgp5A1txZw1DRj1UdklyERVwUhW1yXR1gBLsJyOMVeL9kvVFptK8NsPT4dGgAwMBFDjgX3DcmbMLweZUATof1eBu-l1CW7RGTgsad4P_WO9fLpbd_0UZJas4E3eP2LNtlS-f9j3TvNDk-RlDb747u5fnu7f3xnXTNBqGADqPh0cCM6NUE90o4NpcX700_IXVK0RrMgL4KRgzWB8DG9ytPFPuhO2EQhKLlipzNJXXVk2SuJCY7AudEdjAy6Ap3RNU0sFEoueiu6XkJxiZM2Njz98vFs-3pG2y3YQLpSA3xEpcCAEBtkq1bQIW8f_BoKpy-YQmyPXtwOiaNtOtJgrwHnJkLvUVhAmabslGWV_QhJgArNLAxPJmokWM0dbd9JcxpEQ3jUrKKKH6CYtk0WjesiPCowQ3u2aY-C60LR4kPVG0t0xK7V96NYNIuszioQs1JS11KGpA9w5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