<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/119173>119173</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Miscompilation at -O3
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cardigan1008
</td>
</tr>
</table>
<pre>
This code produces no output at -O3, but prints 5 at -O0/1/2:
```c
int printf(const char *, ...);
static int a[] = {4294967295, 5};
int b, c;
int main() {
a[1] = b = 5;
unsigned d = -13;
for (; d >= 8; d = a[0] + d + 6) {
int *e = &b;
*e = a[0] - -1 + b;
}
a[c];
printf("%d\n", b);
}
```
Compiler Explorer: https://godbolt.org/z/4bzeK4d8x
Bisected to https://github.com/llvm/llvm-project/commit/6d6eea92e36c301e34a7ec11b2a40e3080f79f53, which was committed by @fhahn
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8uu4yoQ_Jr2BiWCBj9YeOEkx5urq9nMD2AgMSPHRAaf19ePwHmMZjdSFEPTVXRV0yoEd5mtbaE8QHkq1BpHv7RaLcZd1MwobYrBm6_25-gC0d5Yclu8WbUNZPbEr_G2RqIi2f3ggEcyrJHcFjfHQMotTAF7Btgj8A5oBxXdfhpo5-Z79hmw0X4OkehRLQSwS2T7_R5QAj8A7UJU0WmSEGqrlQA_EagPAqWQVY2yTJgS6tOGSKlDCunX_qrcDNgAyoQE2pHMxh50Q_4vNwAh65zdMcTk-I7xx8nZpyob4Id89paOn7tTJqWZFHMID6T681KShQB2dlOB1fBgJq_wk2VHdiyTPLOSykf1Gsq75JeZgAhYGiiPc14ekxV3KzfssxFpTbujv97cZBfy9nmb_GIX4B0ZY7yF1DfsAfuLN4Of4t4vF8D-G7AXw7f9T5jmc-M4uGB1tIZE_zfUxXEd9tpfAftpen98drfF_7I6AvbaX68uLSpTWaskWl5pTpnlQtVWMzagEtRy2tBzLc9lfm4fo9Mj-VDpaSZ4unz4IiDoeVTjTArTciO5VIVtWc15jU1dymJspR20kAwNlQZrVgnWmIpLUyshBFV14VqkKBhSSWsmmdw3ddkM1Rml4loII0BQe1Vu2icdyZPChbDaljHJal5MarBTeIzV0ma1w3oJIOjkQgwvXHRxsu3_LujcAxWdn-8jVazL1P6zlbmQkOZuq-W9xd8BAAD__xWKGQ0">