<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/100298>100298</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Miscompilation at O3
</td>
</tr>
<tr>
<th>Labels</th>
<td>
miscompilation,
llvm:optimizations
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
dtcxzyw
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dtcxzyw
</td>
</tr>
</table>
<pre>
```
#include "csmith.h"
uint32_t a;
int16_t c;
void d() {
for (a = -15; a >= 6; a = safe_add_func_uint16_t_u_u(a, 9))
;
c = safe_lshift_func_int16_t_s_u(safe_lshift_func_uint16_t_u_s(a,14), 0);
}
int main() {
d();
printf("%d\n", c);
return 0;
}
```
```
dtcxzyw@dtcxzyw:~/WorkSpace/Projects/compilers/LLVM/llvm-build$ gcc -O0 test.c -fsanitize=undefined -I/usr/include/csmith -w
dtcxzyw@dtcxzyw:~/WorkSpace/Projects/compilers/LLVM/llvm-build$ ./a.out
-16384
dtcxzyw@dtcxzyw:~/WorkSpace/Projects/compilers/LLVM/llvm-build$ bin/clang -O3 test.c -I/usr/include/csmith -w
dtcxzyw@dtcxzyw:~/WorkSpace/Projects/compilers/LLVM/llvm-build$ ./a.out
0
```
llvm version: 2d6ff0c533aa1b0fe6d91764846f636c4a4e911c
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVF1r4zoQ_TXjl8FGHslfD35Ik2u40NILF-59DLIkJ9r1R7DkdNuH_e2LHSdtt8u-FRYEkY4y58zMGUs6Zw-9MSUkd0Ckvfr28vwERJDsAjn54zCWKxjUg34uIWXrYjtgGyBue9VO2iAQKddZf4yOc_xyPdnec9p7lMDvLpDtfZzuPaobch6sRg2UAxUI2YoiNsOIQLlE4DsM4wT4Hc6Hv-Zzej3t0MnG7KXW-2bq1X5aBfbTfpqjgbZYAC1rJUa8aSOqV47WHW3jLzRXFrewfLh-o-JWlVgsKltk8-9VALLdrW7spO0_1rmW_ian02h73ywwASUakm2_bLeo3v9zNH4ae2Qf9X426lfg1W7Brju--Q5U_T-MX_89SWWAqn_G4YtR3gFVauhOtjXjvL-__-8BqGrbcxfWk201kMCDUhg-MvTG-Uhh2DjZW29fDPDd1GvT2N5oDP8GqiY3AlXr7Mzcy-hg-PQ5mUVAlYyGyeOFP4xTnovP0apnkyvVyv6A4SO_deMPKJv9ZjbmSDyb0dmhB75B0mnTMJVwLmVcs8akuoizVOQibVKeKiGFKeJYBbrkuuCFDEwZZxRnhchZHhxLY2qiPFGMF0bUhuomE7HK4yZr6lilJrAlMRIsI8EEMZZHrNCZkAkxLRmXjQHBTCdtG825RcN4CKxzkyljxqjIg1bWpnXr09VZd2mH9HMBy9cCRHMk8M1w8razL8udW5-3sVybdXAgWGudd69C3vrWlA_vSFF6fOTBNLbl0fuTA74BqoCqg_XHqY7U0K0OXI04XbyaLZ8Tn31acz-X9CMAAP__iAGjsA">