public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109442] New: Dead local copy of std::vector not removed from function
@ 2023-04-06 19:00 hiraditya at msn dot com
  2023-04-11 13:28 ` [Bug tree-optimization/109442] " rguenth at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 23+ messages in thread
From: hiraditya at msn dot com @ 2023-04-06 19:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109442
           Summary: Dead local copy of std::vector not removed from
                    function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hiraditya at msn dot com
  Target Milestone: ---

T vat1(std::vector<T> v1) {
    auto v = v1;
    return 10;
}

g++ -O3 -std=c++20 -fno-exceptions

vat1(std::vector<int, std::allocator<int> >):
        mov     rax, QWORD PTR [rdi+8]
        sub     rax, QWORD PTR [rdi]
        je      .L11
        push    rbp
        mov     rbp, rax
        movabs  rax, 9223372036854775804
        push    rbx
        sub     rsp, 8
        cmp     rax, rbp
        jb      .L15
        mov     rbx, rdi
        mov     rdi, rbp
        call    operator new(unsigned long)
        mov     rsi, QWORD PTR [rbx]
        mov     rdx, QWORD PTR [rbx+8]
        mov     rdi, rax
        sub     rdx, rsi
        cmp     rdx, 4
        jle     .L16
        call    memmove
        mov     rdi, rax
.L6:
        mov     rsi, rbp
        call    operator delete(void*, unsigned long)
        add     rsp, 8
        mov     eax, 10
        pop     rbx
        pop     rbp
        ret
.L11:
        mov     eax, 10
        ret
.L15:
        call    std::__throw_bad_array_new_length()
.L16:
        jne     .L6
        mov     eax, DWORD PTR [rsi]
        mov     DWORD PTR [rdi], eax
        jmp     .L6

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2024-05-14 13:47 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 19:00 [Bug tree-optimization/109442] New: Dead local copy of std::vector not removed from function hiraditya at msn dot com
2023-04-11 13:28 ` [Bug tree-optimization/109442] " rguenth at gcc dot gnu.org
2023-04-11 13:33 ` redi at gcc dot gnu.org
2023-04-11 13:38 ` redi at gcc dot gnu.org
2023-04-12  7:40 ` [Bug libstdc++/109442] " rguenth at gcc dot gnu.org
2023-04-12  9:29 ` redi at gcc dot gnu.org
2023-04-12  9:45 ` rguenth at gcc dot gnu.org
2023-04-12 10:01 ` redi at gcc dot gnu.org
2023-04-12 10:13 ` redi at gcc dot gnu.org
2023-04-12 10:22 ` rguenth at gcc dot gnu.org
2023-04-12 10:29 ` redi at gcc dot gnu.org
2023-04-12 10:35 ` redi at gcc dot gnu.org
2023-04-12 11:52 ` rguenther at suse dot de
2023-04-12 11:55 ` redi at gcc dot gnu.org
2023-04-16 18:38 ` richard-gccbugzilla at metafoo dot co.uk
2023-04-17  6:49 ` rguenth at gcc dot gnu.org
2023-04-18  2:15 ` richard-gccbugzilla at metafoo dot co.uk
2023-06-15 18:38 ` hiraditya at msn dot com
2024-05-11  0:07 ` xry111 at gcc dot gnu.org
2024-05-11 16:05 ` hubicka at gcc dot gnu.org
2024-05-14 13:47   ` Jan Hubicka
2024-05-11 16:44 ` redi at gcc dot gnu.org
2024-05-14 13:47 ` hubicka at ucw dot cz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).