<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/80113>80113</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Wrong code at -O2/3 on x86-64_linux-gnu (recent regression)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          shao-hua-li
      </td>
    </tr>
</table>

<pre>
    clang at -O2/3 produced the wrong code. This is a recent regression.

Bisected to 20737825c9122b6e0a8912731cfa7e0558fe025d, which was committed by @antoniofrighetto 

Compiler explorer: https://godbolt.org/z/55z1WT3MM

```console
% cat reduced.c
int printf(const char *, ...);
short a, f = 6;
int b, e, g;
int c[7][1];
static int *d = &b;
long h;
int *const *i;
static unsigned char j(long k, short *n) {
  int *l = &c[5][0];
  int *const **m = &i;
  i = &l;
  *d = 0;
  for (; e < 60; e++)
    ***m = ((h = *d == (1 ^ k)) & *n + f) - 2;
  return 0;
}
int main() {
 j(1, &a);
  printf("%d\n", c[5][0]);
}
%
% clang -O0 reduced.c &&./a.out
-2
% clang -O2 reduced.c &&./a.out
4
%
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVE2P2zgM_TXMhbAhU5E_Dj7kY3MreinQ40KWFVtdRwokeWfaX7-QnWTc6WEBwxYo8r1HmqQMwQxW6xbEEcR5J-c4Ot-GUbpsnGU2mV3n-p-tmqQdUEbMvhLQhePdu35Wusc4anzzzg6oXK9z_DaagCagRK-VthG9HrwOwTibAzsDO6zvowlaxQTgkFjFq5qEagqirtRM1k1BFS_UVVaaCVFfNSPRA53wbTRqxDcZULnbzcQE0f1E2DNpo7PGXb0ZRh2jwy3dyd3uZtIe9ft9cl574AccY7wH4AegC9BlcH3nppg7PwBdfgFdhPhVfP_Gv3zZIkHJ1kc5G9ykH1YSqGTKdilLrlazsRHv3th4BapTQEQ1So9Ah5RMnudADfDj6h1G5yPKdHNF4GcsX1cJqEsXOr2G3-wKxLECcQZxLNLnBRdlNAqTC9ChXxCByu7lMKXfNv6GBXRYZQIdzGek2S7d0q85_ACqF4R_kqRVO9DBAjUI1SMSn_TTkz6pFatatlX78nzxAx1uzyiz9Xsap43xlSHbGK8ulboGfkSNwE9YsuUMdFye5umID74NZQ1Uj4_zCv2wFwjir5R0s2RK5ZI1Ah3xmiwZ0kaC13H2dqMKqvNHuW_S2IVqW7JU2CLVFKiU2_7Aj14CIkgTIU52OZ7wc103cS9KILFp12Wms6_so2kTI1CZA11k7ua4Omf0ZxD9X9D-M-NzbHZ9y_uGN3Kn26JiZVnXoma7sb3KXtV1VVU1p7KjruxLKThjjPGKNZXemZYY7VnBC1azZs_ygsmi4I2SnSp52RWwZ_omzZRP07-3NMc7E8Ks25oVBd9NstNTWDYdkdVvuFym6onzzrcpJuvmIcCeTSbE8IESTZx0-_215baL0Fl8r8us3P89GTu_Z4OdU5P8sfyAmt3sp_bTzjFxnLtcuRvQJfE9Ptndux9aRaDLojIAXZYs_gsAAP__OLmOag">