<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/128139>128139</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Assertion `NumBits >= MIN_INT_BITS && "bitwidth too small"' failed
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bi6c
      </td>
    </tr>
</table>

<pre>
    Compiler Explorer: https://godbolt.org/z/f6Kv68raW
from clang 3.1 (https://godbolt.org/z/zhPazozh5)

Console:
```console
clang: /root/llvm-project/llvm/lib/IR/Type.cpp:312: static llvm::IntegerType* llvm::IntegerType::get(llvm::LLVMContext&, unsigned int): Assertion `NumBits >= MIN_INT_BITS && "bitwidth too small"' 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 -fno-verbose-asm -c --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1.      <source>:21:1: current parser token 'void'
2.      <source>:10:32: LLVM IR generation of declaration 'testvacd'
3.      <source>:10:32: Generating code for declaration 'testvacd'
4.      <source>:14:27: LLVM IR generation of compound statement ('{}')
 #0 0x0000000003e98398 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e98398)
 #1 0x0000000003e96054 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e96054)
 #2 0x0000000003de2458 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007e7b09442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007e7b094969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007e7b09442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007e7b094287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007e7b0942871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007e7b09439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000003852561 llvm::IntegerType::get(llvm::LLVMContext&, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3852561)
#10 0x0000000004545dfe (anonymous namespace)::X86_64ABIInfo::getIndirectResult(clang::QualType, unsigned int) const X86.cpp:0:0
#11 0x000000000454e1d8 (anonymous namespace)::X86_64ABIInfo::classifyArgumentType(clang::QualType, unsigned int, unsigned int&, unsigned int&, bool, bool) const X86.cpp:0:0
#12 0x000000000454ff39 (anonymous namespace)::X86_64ABIInfo::EmitVAArg(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType, clang::CodeGen::AggValueSlot) const X86.cpp:0:0
#13 0x000000000475dc9b clang::CodeGen::CodeGenFunction::EmitVAArg(clang::VAArgExpr*, clang::CodeGen::Address&, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x475dc9b)
#14 0x00000000042195f1 (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) CGExprAgg.cpp:0:0
#15 0x0000000004219eb0 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4219eb0)
#16 0x00000000047b3c92 clang::CodeGen::CodeGenFunction::EmitExprAsInit(clang::Expr const*, clang::ValueDecl const*, clang::CodeGen::LValue, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47b3c92)
#17 0x00000000047bfc32 clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47bfc32)
#18 0x00000000047c0396 clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&) (.part.0) CGDecl.cpp:0:0
#19 0x00000000047c060b clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47c060b)
#20 0x00000000043656f7 clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x43656f7)
#21 0x000000000437b4b4 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x437b4b4)
#22 0x0000000004372c65 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4372c65)
#23 0x000000000437ae9c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x437ae9c)
#24 0x000000000437b359 clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x437b359)
#25 0x000000000437b529 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x437b529)
#26 0x0000000004372c65 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4372c65)
#27 0x000000000437789d clang::CodeGen::CodeGenFunction::EmitForStmt(clang::ForStmt const&, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x437789d)
#28 0x0000000004372e4a clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4372e4a)
#29 0x000000000437ae9c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x437ae9c)
#30 0x00000000043e046c clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x43e046c)
#31 0x00000000043f356e clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x43f356e)
#32 0x000000000445c38a clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x445c38a)
#33 0x00000000044575e4 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44575e4)
#34 0x00000000044579fb clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44579fb)
#35 0x0000000004461e1b clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#36 0x000000000485c4d6 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#37 0x000000000484d284 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x484d284)
#38 0x00000000064aa1a4 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64aa1a4)
#39 0x000000000485a108 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x485a108)
#40 0x0000000004b211e5 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b211e5)
#41 0x0000000004aa498e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4aa498e)
#42 0x0000000004c0fc3e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4c0fc3e)
#43 0x0000000000d5c7ef cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd5c7ef)
#44 0x0000000000d5426a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#45 0x00000000048a0719 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
#46 0x0000000003de2904 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3de2904)
#47 0x00000000048a0d0f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#48 0x0000000004863e8d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4863e8d)
#49 0x0000000004864f0e 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+0x4864f0e)
#50 0x000000000486cec5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x486cec5)
#51 0x0000000000d595e3 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd595e3)
#52 0x0000000000c2b854 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xc2b854)
#53 0x00007e7b09429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#54 0x00007e7b09429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#55 0x0000000000d53d15 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd53d15)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
Code:
```c
struct S {
  double i[];
};

void __attribute__((noinline)) checkcd(struct S x) {
  if (x.i[0] != 7.0 || x.i[1] != 8.0)
    __builtin_abort();
}

void __attribute__((noinline)) testvacd(int n, ...) {
  int i;
 __builtin_va_list ap;
  __builtin_va_start(ap, n);
  for (i = 0; i < n; i++) {
    struct S t = __builtin_va_arg(ap, struct S);
    checkcd(t);
 }
  __builtin_va_end(ap);
}

void testitcd(void) {
  struct S x = {{7.0, 8.0}};
  testvacd(2, x, x);
}

int main() {
  testitcd();
  return 0;
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsW11z4yjW_jXkhrJLAn1e5EJxkn4zb89sb6erZ-5cCCFbGxlUgNJJ__otQLY-bCdxxj07s7NdScdGcHie5xwORzImSlUrztglCK9AeH1BWr0W8jKvInqRi-L5ciE2TVUzCW-emlpIJgHO4FrrRgGcAXQL0O1KFLmo9VzIFUC33wG6LaP_f4wSSX4FXlZKsYG0JnwF8dyHACWvjf6-_kS-i-_rEKAUeBn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