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

    <tr>
        <th>Summary</th>
        <td>
            [TBAA][DSE] bitfield store is incorrectly optimized out
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            miscompilation,
            TBAA
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            fhahn,
            dobbelaj-snps
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dtcxzyw
      </td>
    </tr>
</table>

<pre>
    Reproducer: https://godbolt.org/z/jKrGW5jEh
```
#include <stdint.h>

struct S1 {
   signed f0 : 9;
   unsigned f1 : 2;
   int8_t f2;
};

struct S1 g;

struct S1 func(struct S1* x) {
 x->f2 = 3;
    *x = g;
    return *x;
}
```
`x->f2 = 3` is incorrectly eliminated by `DSEPass`.
This miscompilation is caused by recent commit https://github.com/llvm/llvm-project/pull/81313.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU02PozoQ_DXNxZrItIHAgUMyhHd4l6c3I-1xZRsTHBmM_LGbzK9fQTKTyWj3sBICXCWXq9rd3Ht9nJSqId8DYj_wYQJEwGdA7KwQyvDTk59mv6B5k_AYBuvqLsjz2-VnImx3qf9Xs7NdlMoB25EhhNkD2wG2gO3RdsKasLHuCNi-Abanf90_3_LTYQDaAN1BQW_PdYlMT9LEThFgzz50egqbAdjhRq9vH1yUgbykBLb7K0QIWZN0pKdksVEBu1NxeifTlcTPpJ5C-T2Q_g7Ctrn_fznx-Eemj5MELD8AwB05A1afTJ6fgB16JMAawj57IIC78wofH2CnQnTTyj64-23pCvqoX1CiPdGTtM4pGcyFKKNHPfGgOiIuBAravBz-495DQTdXkddBezJqL-04a8ODttMiInn0101OSTUFIu046vD1snUYothIOwK2xvx4_zzNzp6UDIDtHI0BbMuUpex2ZNLVrKtYxRNVp1ta5iWmZZUMtchEJviWp3S7LbM-rQSVnNM-55niac8TXSPFjCIiLWiVVZsy51WVC8FEWRT9lkJG1ci12Swulh5MtPdR1SXmZZEYLpTxt9Z_zPwxA6_73e7W-q5es4h49JBRo33wd92gg1mnaN2QN5Dvm5cD5A0ROvRamY74YJ36eiN2DnrUb6ojNoYkOlP_dUnXSH4p6pLqVwAAAP__CeEfTg">