<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69885>69885</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
wrong code at -O1 and above on x86_64-linux-gnu
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zhendongsu
</td>
</tr>
</table>
<pre>
This seems to be a recent regression.
Compiler Explorer: https://godbolt.org/z/T7ET4PWsW
```
[573] % clangtk -v
clang version 18.0.0 (https://github.com/llvm/llvm-project.git 00c8da615923974c6c91603555b723c600dbb5f2)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
[574] %
[574] % clangtk -O1 small.c
[575] % ./a.out
Aborted
[576] % cat small.c
#pragma pack(1)
struct {
int : 2;
int a : 2;
int b : 30;
} c;
int d, e = -1;
int main() {
int f = ~(e & 1);
c.a = -(f | d) ^ -c.a;
if (c.b != 0)
__builtin_abort();
return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VF1v6zYM_TXMCxFDlj_14Ic2qYc9bcAK3MdCX3a0ylIgyW3Xh_32wXab5gYXAwbcAUESkoeHhwRFHqMZndYdVPdQHXd8TicfuveTdsq7Mc474dVf3ePJRIxaTxGTR6GRY9BSu4RBj0HHaLzLgByB3G3fBz-djdUBH97O1gcdoLjDU0rnCMUd0B5oP3olvE2ZDyPQ_h1o_9g8PJa_f4vfrpmgJh-fzazuq6aA6ohAK5SWuzE94_5li642vuiwCMK8zUhGEGh7U9mk0ywy6SegvbUvnz_7c_B_apmy0SQkRLaK13nFaMGaUtaS5TUpqqoSDS1kTYgSohooULbVfuRh1Gnp862tn-pyP7tn51_d3ho3v-1HN3_gTkFzhZNX2i7os4_mbQv96mLi1mp1NOvAFl1ecgu0j_P7_vO_Pw_z-zIwYdyW2PvZKZTcKaN40vjL4YBmI-PJePdBNsewUBqxDEFKoP2H1C-JtM_J_8CZ_3zOj7H_oa2WSaufou9wUTbNNpklq7jDDIp7KMlUlzcl_w20Lmr5uag_8l2W97cc48StzeQVrPqEZUB7nvk5bcE74UPS6gpZXwh5uiGixTnwceJ45vIZaJtftjWmMMuE0NxvNhqXcOmDLn1srtXHf-gVq7cgFzc0R5QXa4EooAfUCMUR9_l3kYkbB7QFyq7qr7TDCv8baKsRaI2r3q_KMuMbH9B2QGgOSxGGUD3gXmb8WuOwPHuZCQSaLynk0jki4tOTmI1Nxj3xZZybmKv0oNMcHH7X3s052qmuUKxgfKe7vGYNY0VRsN2payRhqmUDU0IPQlakLgZa1oTxtmyIGHamo4QWOaE0r8u2YpkiFVN5rshQV3JQNZRET9zYbDlKy33cmRhn3dWsbaud5ULbuB5sSp1-xTUIlC73O3TrIRPzGKEk1sQUv1iSSVZ3r8G7EaVXGnlal487hVz4F43e4e3r2M3Bdv_tfgLtV00RaL9q_icAAP__sW7b7Q">