<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/149289>149289</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[X86] Uninitialized variable warnings in immintrin.h - static analyzer - __builtin_ia32_rdsspd / __builtin_ia32_rdsspq
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
buscher
</td>
</tr>
</table>
<pre>
Kind of related to https://github.com/llvm/llvm-project/issues/55224 , but for the static analyzer.
For the code
```
#include <x86intrin.h>
int main() {
return 0;
}
```
when I execute:
```
scan-build -analyze-headers cc main.c
```
I get:
```
scan-build: Using '/usr/lib/llvm-20/bin/clang' for static analysis
In file included from main.c:2:
In file included from /usr/lib/llvm-20/lib/clang/20/include/x86intrin.h:15:
In file included from /usr/lib/llvm-20/lib/clang/20/include/immintrin.h:577:
/usr/lib/llvm-20/lib/clang/20/include/cetintrin.h:49:10: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
49 | return __builtin_ia32_rdsspd(t);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/llvm-20/lib/clang/20/include/cetintrin.h:62:10: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
62 | return __builtin_ia32_rdsspq(t);
| ^~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
```
Happens with llvm/clang 14 and 20, did not test other versions.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8lc1u3DYQx59m9jLYBTX6Wh10kNcRGhQ9BujNoMhZiQWX2pKUneTQZy8oaxHHcVDACEoIkPg1M_zN8C8ZghkdcwvlHZT3O7nEafbtsAQ1sd8Ns_7S_m6cxvmMnq2MrDHOOMV4DZB3QD1QP5o4LcNBzReg3trH22t_9fNfrCJQb0JYOAD1ZUlUINAJhyXiefYYJ8YQZTQKpZP2y1f2BxAdiK7fZtWsOY1UYntEB5Qbp-yiGSE_fT5WxkVv3GGC_MPzZuMiXqRxQEegBqG-A9Gh57h4hwLy1IX6_rVd0T1N7PAj8mdWS-R0yO-XBCXdfliM1bjfAt5PLDX7gEqtPg_qR7MfceS4WfuZQcg7_BSMGxGoBuqX4BNKM9yAkgDqh3SoXlnpRqB6ZfiSXzAhuXN4NpZxo6Tx7OfLLbi8o-dI3l71U8_P_c1zvw5tO4H675LQZeWv92AulxceyrrecL7LmOL4wljRpJhFSsCT9M64MX1mIeJ5cSqa2aGS1qL043JhF9EElA4XZ5yJRlrzlTU-SrswQnmnZs-Hk7S2c_oPDkGODGUqNUQsUi2eEG-l-PCQUh-NezAypwevQ7hqoGMEap6rFNeWNkH54Z-32y_CUNH_haGi_8bw93sw0C3ygCM79kmyDj9ex9_k9cou4JOJE26atSLCrEDpNCZOJ9RGo5sjRg4R5zixx0f2wcwubCK1022um7yRO26zuqS6pLLJdlMr9KAqao6lplzklcirbJBVWdVSiqoiuTMtCSpFndVZVuSZOIhMkJJ5UevjsagLAYXgizT2kOI7zH7crTLaZkVDx2Zn5cA2rMpN5PgJ11kgSkLu27UAhmUMUAhrQgzfzEQT7Sr5fx4rKO_x06v8eSMHy99AGocv7h7uX-s17t8u43TP387sbvG2ff9fZCPw2NK_AQAA___8fyKx">