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

    <tr>
        <th>Summary</th>
        <td>
            Packed struct doesn't support i24 fields
        </td>
    </tr>

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

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

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

<pre>
    Under StructLayout constructor in DataLayout.cpp line 70 field size is added to total struct size like this:
```
StructSize += DL.getTypeAllocSize(Ty).getFixedValue();
```
Shouldn't this be replaced with:
```
if (ST->isPacked()) {
    StructSize += DL.getTypeStoreSize(Ty).getFixedValue();
} else {
    StructSize += DL.getTypeAllocSize(Ty).getFixedValue();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUk1v3CAQ_TX4MorF4q_l4MOu3JxyqLTb3jGMbRpiLD6abn99sb1RpaqNUjQSzDx73uMNvVW39sus0MEluCjDk7jZGEDa2W-5daBn6EQQO5LLZQGjZ4SGwqDRKPD6J4L2IJRCBcGmCMLA_v-OGv2MECbtSXEitCP0RGp6jy3dyS_rt4SdSdFB95SPGK63BU_GWLlChB2vN8L4CjzqH6i-ChPXaqqR4vz3xpONRs2ENWETAD2Cw8UImbS-6jD9S5EekpLj5fpAik_afxbyGdWdinEgzZ0O0npP_CU5iB8X33SAxuPH-_-nOU33x2Uz1RaKF1xkQQeD7X7Rt-Epi373zsdlsS6AZuU-dp9FZ9ophGUbKntMMSY_Y59L-5ISY76_bQ-Ls99QhpRq7yP6dKjK6lBmU1vWyFHxeqjFQCtRS8p5M8hqOKhSplJmRJ8saUl1JozN-Apbi3QmVZfpllHGaMGKA6dldcyPquYivUM-DH0zKEpKii9Cm3zVkVs3Zq7dJPVx9Ak02gf_GxTe63FG3OhSfxHDZF2rR-uOZbYxt5vyXyqV_ow">