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

    <tr>
        <th>Summary</th>
        <td>
            Backport UB workaround (94f7c961c78d8fdbc05898cfbbf88094de45c1ad) for GCC LTO builds
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            cmake,
            release:backport,
            llvm:optimizations,
            LTO
      </td>
    </tr>

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

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

<pre>
    See https://github.com/llvm/llvm-project/issues/57740 and https://github.com/llvm/llvm-project/issues/24952.

Without this, LLVM is miscompiled (because of UB in User.cpp) when built with GCC LTO. Given that `-fno-lifetime-dse` is a GCC only flag and we know it was miscompiled otherwise with GCC LTO, I think we can safely backport it.

/cherry-pick 94f7c961c78d8fdbc05898cfbbf88094de45c1ad
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykkk-PmzwQxj-NuYyCzPDHcOCQZJXVK-2rHtptz7YZghuDkW0WpZ--gipb7a1qD7YPo_HM8zw_GYK5TkQtK0-sfErkEgfn2zhQkON2EuW6e_uZCIYY58DyI8MLw8vVxGFRqXYjw4u1b4_nMHv3nXRkeDEhLBQYXkohCg5y6v7hDyyaElPGnxg__rq_mTi4JUIcTGB4hpeXr_-DCTCaoN04G0sdMKwVabkEAtfD6wnMBK-BfKrnmWED60ATqMXYCKuJAzyfz_Dy5VMKz-aNJoiDjMAqfugnd7Cmp2hGOnSBWMW3UXJvcJO9Q2_ldZe4Etwmt4KJsMqP27g4kF9NoA_Dtt3_21RMt61ZywmC7MneQUl9m52PYOIH5QwveiDv74fZ6Bs0RS90U2Va1F3dd0rzsm5q3SvV1zVvio6KUmeyS7o275q8kQm1WVUXHHlRiWRoM6VFXneikVxgWfBMl5hnShVFz7lWlJgWOea8zHLMURQiRV5jJbJMZI2QknJWcBqlsekWX-r8NdmDayusmiaxUpENO2KIepQ3YogMzwzRkyUZiOXHh9j30g5EfnRzNKP5IaNxU3gv7r7hRqxvd2TUcg2s4NaEGH5vEU201J4ePr6eYHX-Jr1bph2OP7VuY6V3_hHZjkwXksXb9u-R3s35GQAA___a6hvN">