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

    <tr>
        <th>Summary</th>
        <td>
            Serie of std::vector::push_back(U8) poor generated code
        </td>
    </tr>

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

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

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

<pre>
    Hello everyone,

I was playing around with Godbolt and noticed some weird behaviour of clang++ (and G++).

An example is better than a thousand word so just compare the output of -O3 and no optimisation:

https://godbolt.org/z/Y3qeYx5xd

I just feel O3 could be way cleaner than that. **It actually happens also with O1 and O2.**
I dont get why we see the same values repeated over and over again like : 9223372036854775807

PS: I am nowhere close to be a compiler programmer so I don't even know how to help you with it or if it is normal behaviour of the compiler. Just wanted to notify and see what you guys think.

Cheers,
Scr3am
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcU01zo0YQ_TWjS5dVaJBAHDjIu6WNc3GqXDnsKdVAi5n1ME1mGmHy61MD68TeCzRUv3kfPDBG23uiWp0e1enrDicxHOqXNuQ4UNg13C31b-QcA90pLOxJ6S8q-6qyy3Z9ghkjjA4X63vAwJPvYLZi4Bt3DTsB9B14FttSB5EHgpls6KAhg3fLUwC-QevQ90o_Kv0ISp8T5Nv2qHS1_8h38UBvOIyOwEZoSIQCiEEPCGJ4igk7c0hc8GOKAi0PIwYCMQQ8yThJYnx4zn8qAx7FDjaiWPYqv3xkMyJjTO_0Velrvznac-iVvv6j9PV7_jd9fzu9dZ8jWXlvRA6ec2h5cskuzLhA6wj9u2IxKHtQ-qL05UkAW5nQuQUMjiP5COgib1k-H1axz3q_bb8TdewFehKYzQIzQaTNZ8SB4I5uogiBRkKhDvhOYT1mG3q0Hpx9JVD5BSqt87zUWV6cT8eyPJ2z8qOnP17S0hPgAJ5nQ4GgdRwJhJM1XFO2jgKMgfuAw0AhfYFVotKlpP54ePU8g-E5wQy5ERaeNodWgAPYWxpsBM9hQPe5JMnYO80efk8Zz-iTM-G1YbdltZdCmA3Keng_LRHEWP_6qUZfDFGI_3V5K_yuq_OuyivcUX0oqmNWHbNjtjN1Xh1OeVYW5xYPRdc1ZUZ4OjVtday6nIrzztY603lWZeUhT5h9qfFW3W5lUTZV2RY3dcxoQOv2zt2HVKCdjXGiujgVWblz2JCL7z9hqNPSQzP1UR0zZ6PE_2FixVH9QsFSyiRKl-qZX-7UCodtHqdo_mqwfVX6_OdZ6QpG5gA9eQprE1ruaDcFV__SbytmavYtD0pfE-PP28MY-Ae1ovR1VR2Vvq7C_w0AAP__lWNgXg">