Issue |
128139
|
Summary |
Assertion `NumBits >= MIN_INT_BITS && "bitwidth too small"' failed
|
Labels |
new issue
|
Assignees |
|
Reporter |
bi6c
|
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;
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs