<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63945>63945</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang: Assertion `!Info.isIncomplete() && "Access to an object of an incomplete type!"' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wierton
</td>
</tr>
</table>
<pre>
The bug triggering program is shown below:
```
void a(void *c) {
(void)c[1];
}
```
When attempting to compile it using `clang-17` with option `clang-17 -O1 small.c`, clang triggers an assertion failure (Compiler Explorer: https://gcc.godbolt.org/z/dfYj5fxzj):
```
clang: /root/llvm-project/clang/lib/CodeGen/CodeGenTBAA.cpp:432: llvm::MDNode* clang::CodeGen::CodeGenTBAA::getAccessTagInfo(clang::CodeGen::TBAAAccessInfo): Assertion `!Info.isIncomplete() && "Access to an object of an incomplete type!"' 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 -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics -O1 <source>
1. <eof> parser at end of file
2. <source>:1:6: LLVM IR generation of declaration 'a'
3. <source>:1:6: Generating code for declaration 'a'
#0 0x0000563e2569ac1a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3a9ac1a)
#1 0x0000563e2569884c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3a9884c)
#2 0x0000563e255e7020 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f78840f3420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f7883bc000b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f7883b9f859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f7883b9f729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f7883bb0fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x0000563e25a6e8b8 clang::CodeGen::CodeGenTBAA::getAccessTagInfo(clang::CodeGen::TBAAAccessInfo) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e6e8b8)
#9 0x0000563e259e8960 clang::CodeGen::CodeGenModule::DecorateInstructionWithTBAA(llvm::Instruction*, clang::CodeGen::TBAAAccessInfo) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3de8960)
#10 0x0000563e25d07b00 clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(clang::CodeGen::Address, bool, clang::QualType, clang::SourceLocation, clang::CodeGen::LValueBaseInfo, clang::CodeGen::TBAAAccessInfo, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4107b00)
#11 0x0000563e25d07eb7 clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(clang::CodeGen::LValue, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4107eb7)
#12 0x0000563e25d08592 clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(clang::CodeGen::LValue, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4108592)
#13 0x0000563e25d51392 (anonymous namespace)::ScalarExprEmitter::EmitLoadOfLValue(clang::Expr const*) CGExprScalar.cpp:0:0
#14 0x0000563e25d55b3b (anonymous namespace)::ScalarExprEmitter::VisitArraySubscriptExpr(clang::ArraySubscriptExpr*) CGExprScalar.cpp:0:0
#15 0x0000563e25d504e6 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#16 0x0000563e25d50c36 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4150c36)
#17 0x0000563e25cfaa2f clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x40faa2f)
#18 0x0000563e25d1861b clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x411861b)
#19 0x0000563e25d566f6 (anonymous namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) CGExprScalar.cpp:0:0
#20 0x0000563e25d4f3db (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#21 0x0000563e25d50c36 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4150c36)
#22 0x0000563e25cfaa2f clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x40faa2f)
#23 0x0000563e25d1861b clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x411861b)
#24 0x0000563e25971fc8 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3d71fc8)
#25 0x0000563e259767ec clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3d767ec)
#26 0x0000563e259cf818 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3dcf818)
#27 0x0000563e259e072b clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3de072b)
#28 0x0000563e25a372dc clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e372dc)
#29 0x0000563e25a33345 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e33345)
#30 0x0000563e25a33863 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e33863)
#31 0x0000563e25a3ae63 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.8518) CodeGenModule.cpp:0:0
#32 0x0000563e2676a260 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#33 0x0000563e2675daee clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b5daee)
#34 0x0000563e27a3a214 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5e3a214)
#35 0x0000563e26767560 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b67560)
#36 0x0000563e260892e9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44892e9)
#37 0x0000563e2601dc42 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x441dc42)
#38 0x0000563e26160c9f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4560c9f)
#39 0x0000563e22e22cc3 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1222cc3)
#40 0x0000563e22e1ade8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#41 0x0000563e25e912f9 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
#42 0x0000563e255e74a5 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x39e74a5)
#43 0x0000563e25e93eee clang::driver::CC1Command::Execute(llvm::ArrayRef<std::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+0x4293eee)
#44 0x0000563e25e6060b clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x426060b)
#45 0x0000563e25e611e3 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+0x42611e3)
#46 0x0000563e25e69fd6 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4269fd6)
#47 0x0000563e22e20a8e clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1220a8e)
#48 0x0000563e22d51cb1 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1151cb1)
#49 0x00007f7883ba1083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#50 0x0000563e22e1a4da _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x121a4da)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
```
The version of testing clang is (associated with commit f05b58a9468cc2990678e06bc51df56b30344807):
```
clang version 17.0.0 (https://github.com/llvm/llvm-project.git f05b58a9468cc2990678e06bc51df56b30344807)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-assertions-trunk/bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWltv27jW_TXKC2GDInV9yIPjJP0yyHztaYIOzpNBUVuyprIokFQu8-sPSMmOqNi51S0GM0AbWCS1udbam-QmRaZUVTYAp1545oXnJ6zTayFP7yuQWjQnmcgfT2_XgLKuRFpWZQmyakrUSlFKtkGVQmot7huUQS3uPbrw8LmHF16Eh3_28U5UOWIeSewPjyy4R1LkxWd9NUJDlUdS7oVnvheee3So9OLzvTb7v3-soUFMa9i02uDSAnGxaasaUKVRp0yZF2Fes6ac-bEXYXRf6TUSra5EM65Cs88-UhtW13NuOiFLZKu2rBViDWJKgbRvFqyqOwkG-bLvUKKLh7YWEqRHF2itdauMHuTSI5cl5_NS5Jmo9VzI0iOXf3nkMi_--2dYPPz1p0fSQ9JZDMagRy6lENojl3V9t5m1UvwJ3Dz2LchlXWUeuVyKHD5B8_Tr9myxmPO29egioMRYMu-b7uji9_P_Fzl4ZIG23Xh0sbUwfjBG-oIS9IJzUOqWlVdNITySHHrXvNS37RsajmixU9CK7JuqeaWuGuO2GjR4JLHBQSKPRMgjpDdhPMsaJDLDGonCPFS7l5B-bMEjvkeIR2LrHMjnvYJfri8WNxdIddmm0ojZSJbQCqmNzYmfKr3usjkXm0Hn53JXSnWgPHKJWJMbCHWXA9JrQFwytUYZ49-1ZBxMBLUSWikMfsiREp3si82bTCnBK6YhR7JrkOKyavUA-UYz_h3l3abdhQWeezj9Mow6JstuA41WQ2CI1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