<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83419>83419</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang: Assertion fail for simple _Bitint code
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Given this source code:
void f()
{
static _BitInt(130) p = {};
}
then recent clang trunk does this:
$ clang -c bug38.c
clang: /home/dcb38/llvm/trunk/clang/lib/CodeGen/CGDecl.cpp:366: llvm::GlobalVariable* clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(const clang
::VarDecl&, llvm::GlobalVariable*): Assertion `VarSize == CstSize && "Emitted constant has unexpected size"' failed.
A slightly smaller size of 120 seems to work ok. It looks like the
boundary size is likely to be 128 or so.
If this is a fixed boundary, a tidy "not implemented" error message
is better than an assertion fail and a crash.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U8Fu4zgM_Rr6Qkxg007iHHxwm3XR8yx6XdAWHWsjS4Ekdyf9-oWcpNPuYQFDsCjykXzk4xD0yYo0sH2C7THjJU7ON2roy6LKeqeuzYt-F4tx0gGDW_wgODglULaQHyG_n-9OKxyBaqDD3b5_ejgcQuSoB_zrScdXG4HqosyBDnhBKI-YPPdHKJ_wEXn8Ch0nsehlEBtxMGxPGP1iz6ichLWs_5QCVN39fgzYL6ey3gy3l9UKZYtA3eRmAepSozVQZ8z7DNStyEDdzZM6o3ug7tkpeRGb_l6OMpjNcLlA2Za7XQJbQ8sWyvbFuJ7NG3vNvRGgFh8ZoWwfIF8v3WKHqN3d2Cr1anXUbPSH-D_dz5W1N_YpJ1A9OBvuFNw7XcM-HXZAz_9XTRpN2WIbgviUFWGXv7H_qT8kzSGN4jnE2zWB7RCI_ph1jKJwTc424sQBFyu_LjIke9AfAkRAexxZG1Gbr7NoMRh9mqK5YpjZGPFrALoRC8oxiMwBo8N_nD-jO2_wNaJx7hzQ6LNgnOSG07vFKvbXW7S-PZtrCu0FC6rReQzuW-7X8ba0OiDjqH-JwgdMIooxanVNLVoXUc8XI7PYKAqIULx3HmcJgU9yX0sdsJcYxWOc2GL6PplMrSNbhYyD5zB9K-R2Zqop1aE8cCZNsc8PVOTVvsimJt-pWkm1rXPhuipyqni_7et-zzWPovJMN5RTlRMdCqqKotiMY18X25FHtRVhZqhymVmbTRr-xvlTpkNYpKnLqjhkhnsxYRU40X2xKWndN8n_R7-cAlS50SGG3whRRyPNp2La762Oie6Vs1XUOknTKckWb5opxsuqSeqAupOO09JvBjf_Vtma9uLd3zJEoG4tNgB1a73_BgAA__-TA2zS">