https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108162

--- Comment #3 from Levo DeLellis <levo.delellis at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> Round 4 is because of this heuriheuristics. Name the function something
> besides main and try again.

I couldn't reproduce. fn has more than xor eax/ret. godbolt shows the same.
x86-64 12.2 https://gcc.godbolt.org/z/WdacrE788

#include <vector>
int fn() { std::vector<int> v; v.push_back(1000); return 0; }
int main(int argc, char *argv[]) { fn(); }


0000000000001160 <_Z2fnv>:
    1160:       48 83 ec 08             sub    rsp,0x8
    1164:       bf 04 00 00 00          mov    edi,0x4
    1169:       e8 c2 fe ff ff          call   1030 <_Znwm@plt>
    116e:       be 04 00 00 00          mov    esi,0x4
    1173:       48 89 c7                mov    rdi,rax
    1176:       c7 00 e8 03 00 00       mov    DWORD PTR [rax],0x3e8
    117c:       e8 bf fe ff ff          call   1040 <_ZdlPvm@plt>
    1181:       31 c0                   xor    eax,eax
    1183:       48 83 c4 08             add    rsp,0x8
    1187:       c3                      ret

Reply via email to