From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EFE393858018; Sat, 15 May 2021 12:28:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFE393858018 From: "nilsgladitz at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object Date: Sat, 15 May 2021 12:28:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nilsgladitz at gmail dot com 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 attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 May 2021 12:28:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100611 Bug ID: 100611 Summary: coroutines: destructor called too many times for coroutine lambda stored object Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nilsgladitz at gmail dot com Target Milestone: --- Created attachment 50816 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50816&action=3Dedit test case Given the attached test case compiled and run with e.g. g++ test.cpp -std=3Dc++20 -fcoroutines && ./a.out produces the output: Foo(23) 0x55c938eb5ed4 Foo(const& 23) 0x55c938eb5ee4 ~Foo(23) 0x55c938eb5ee0 ~Foo(23) 0x55c938eb5ee4 ~Foo(23) 0x55c938eb5ed4 Indicating that "Foo" is constructed more often than it gets destructed. This may be a variation of or related to bug 99576 which my test case is ba= sed on. Bug 99576 seems to be observable in 10.2 while this new issue seems to be observable in 10.3 and 11.1. Bisecting the gcc-10 release branch the dividing commit seems to be: commit f43a1b1d1718969423337190ddbbbc9037c67783 Author: Iain Sandoe Date: Sun Jul 19 18:39:21 2020 +0100 coroutines: Correct frame capture of compiler temps [PR95591+4].=