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

    <tr>
        <th>Summary</th>
        <td>
            Clang doesn't reuse stack memory from separate scopes within a function
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Code example: https://godbolt.org/z/s5eYh4oaY

The compiler allocates enough space for both structs, even though they're only used very temporarily. I see this as a missed memory optimization, although I could be wrong as I don't fully know what the C standard says about this.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxckk-PnDAMxT9NuFg7ggDz58BhOhXVntvLHk1iIN2AUWxmyn76iulWlXrK5fk5v_eMImGYiRpTfzH11wxXHTk13zUR6QMTfcOJJOvYb82NPQH9wmmJZMorjKqLmPJqbGtsO7DvOOqB02Bs-2FsKzW9jRXjm8mvJr_-GAkcT0uIlABjZIdKAjTzOowgCzqCnhN0rCOIptWpGHsDutMMOj5VOtJm7CkR8Bw3WIU83CltoDQtnDCFuB3gFYQIdAwCKIAwBdmFE02cNuBFwxQ-UAPPuz_GT_NXcLxGDx3BI_E87MOv4HfVSaFfY9zgfeYHPEbU_StwA1GcPSYPgpsAdrzqc_Eh803pL-UFM2qKU3kuy1N-tNnY-LJwWJ_paPMCS-fr8lzYY3WsXe-t7c9ZaGxu67woi6K2lS0OjqrK5uWxOl0u7nzuTZXThCEeYrxPe95ZEFmpKWxty3MWsaMoz0KtdRHnwVi7d5uafeClWwcxVR6DqPyz0KCRmtsuB88kf6ATrUI7pHv_G1-feAKhBRMqgTheSOARdAwzIPTr7PZgszXF5r8DCTqu3cHxZGy77_18XpbEP8mpse2TQ4xtP1Hujf0dAAD__3XG4e0">