<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154097>154097</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
When compiled with -O3, Clang generates results that do not match expectations, whereas GCC produces the expected output.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
CornerWhisperer
</td>
</tr>
</table>
<pre>
reproduceļ¼
```
#include <cstdint>
void test(int32_t op0,
int32_t op1, int32_t op2,
int32_t op3, int32_t *op4) {
int32_t *ptr;
ptr = &op0;
*(ptr + op1) = op2;
*op4 = *(ptr + op3);
}
```
https://godbolt.org/z/Wdxa6Ecsc
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkkk9vnDAQxT_NcLGyMmP-HjiwJPTYY46V154FV16M7CFJ--krNlRJUwkJ8d7veTzD6JTctBB1UJ6hfMz0xnOI3RDiQvF5dmmlSDG7BPuri7TGYDdD8DTCeYC2B9lDJY9H9gJQucX4zZIANZjE1i0M6mn3XoKzgikxYOMWVviDRVgl4CB2Wwjxoea7-vGJgMN_jPrMAPZhLQBbAfX5Hf1krRxBHfLKUYB6FIDVXv2vDNgDNncTz-83aO_cXv0TFNbiiP_LK8D24KB-_DIXkP3MvCZQPeAIOE7BXoLnU4gT4PgbcHy2b7p6MslktlO2Va3OqMvrsizzqiyqbO5Mrq28FrquLtc6z01dX9FSZdBcr9Y2lLkOJZayyZs8x1ZWp6bRpa0b2Sg0qJSEQtJNO3_y_uW2185cSht1eVnIts68vpBP90VANF4vEyDuOxG7PfBw2aYEhfQucfo4gh176p5nWoQJt9V5suLV8Swevt__0LAfJCZaKGqmJCKlzXMSPGsWNoglsLhpNrOgt5UMa3ZhSXvydaZIOolvwyCOxdtjdIBkRdh43fiUbdF3XwbseN4uJxNugON-1-P1sMbwkwwDjvfeE-B4tP_S4Z8AAAD__13R6jo">