From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 402733844752; Fri, 10 May 2024 15:16:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 402733844752 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715354198; bh=f/jzgnhsqUDNHbrlmwp9akqt3KdNSd4Bua6kC3wplWY=; h=From:To:Subject:Date:From; b=LPu/f+9+wHDVhbz10hZDGAxnbghPFMkyBkmA6VGCQMAh2HqWHOKdRkGNZ8abBpyW3 IVx//fMphHJQlLpeC2ZFUlKAjD61GhXVbR6ROGJqe/WusyNT/IZn8vYLnwhUev3MMS Fd7M76qIPMzM+bOlAy5MNZG59eMmtkJFL0POkU/Y= From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/115037] New: Unused std::vector is not optimized away. Date: Fri, 10 May 2024 15:16:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115037 Bug ID: 115037 Summary: Unused std::vector is not optimized away. Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org Target Milestone: --- Compiling=20 #include void test() { std::vector test; test.push_back (1); } leads to _Z4testv: .LFB1253: .cfi_startproc subq $8, %rsp .cfi_def_cfa_offset 16 movl $4, %edi call _Znwm movl $4, %esi movl $1, (%rax) movq %rax, %rdi addq $8, %rsp .cfi_def_cfa_offset 8 jmp _ZdlPvm while clang optimizes to: _Z4testv: # @_Z4testv .cfi_startproc # %bb.0: retq=