<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54390>54390</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Slow compound value binding with C99 designated initializers.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:static analyzer
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
haoNoQ
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
haoNoQ
</td>
</tr>
</table>
<pre>
https://discourse.llvm.org/t/enormously-huge-analysis-time/60969
The following code takes 30+ minutes to `--analyze`:
```c
extern int f (const char *);
int g (int x) {
char *v[] = {
[0] = "",
[1234] = "aaaa",
[123456] = "bbbb",
};
return x < 0 ? -1 : f (v[x]);
}
```
Looks like we're trying to create a symbolic array of 123456 elements and explicitly write down each element, and then expand it into separate RegionStore bindings element-by-element. The analysis assumes that if elements are explicitly written down, there's few of them so explicitly writing them down doesn't hurt. The C99 designated initializer syntax used here suggests otherwise.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VNuOmzAQ_Rp4GRERDCE88LC70T5VldrtDxiYgLvGjnxZwn59xySbkkgtcsCe6zkznjS6m-vBuZON2FOUvdLqhG21NxY3Un6MG216Ejr6odJm1N7KORl8jwlXXM5W2MSJEUm_S6tdFaWHKH26vH8NCEctpZ6E6qHVHYLj72iBpVH2DKNQ3tHJaYh2aXKJ94m0D1hWcYJkWe3ljGeHRoFQDo4QZftWK-ugHbihE7GoIva89g-GfTAMmzPpISqvBnBz-4iK56g4QMQOazUAydObIsuW9XKn3mYsX1lwev5hVexWdg0993ZReXiADmDQeSJ7Jq8XSOn9CsmWPk8X7gH2mYLesaYw94Vbh_ym9bsFKd4RJmpbaagrZg4doka0BrlD4GDnsdFStMCN4TPoI1zwA0ocUTkLXHWA5xPZCCdnmIwgx05PCpC3w5cdsVss3YAqmIe9cKF3GiyeuAnpfmIvtHpzmrA0QnUExn4FSJo5uW43EG7U17UDbq0fw_0ZOAU8rpBRmAdkjrIHbAEOQTGBuIUjToEZCUaw-tFnKUlQLaQ6jZbcSweDN1coL1UFHVrRK2JBvBQ5cSk-0VD9lONn8JbkIR9Y3_doCZ0O-SdB8xV3NesqVvHYUVKs32hSaEzGk_ZUpQ8u_a0cMAk3_Cef3cTeyIdJ7snHNxuKSIcwzNdPcjL6N7ZhpgXVEC1tipxVaTzUBW-q_Z4zhmyf7fK83O7KtE1Zxqqu7Xb7WPIGpa3DtGRZK7nqKZ913IW7cplgE251cYhFnaVZlrJtsa3SLM83xXHb7auGIXbltihZlKc4ciFv_zSxqReAje8tKaWggv1VUsOJOuI1-cD1d_3jmot7N2hTX2TxQqteOP0BmhKD7A">