From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C4FD3858C2A; Sat, 24 Jun 2023 16:33:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C4FD3858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687624396; bh=xjm8BN1n51aziz/tHgECWmYeM970GE2Kp7PH2tAzhCQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LCPatjEbR6hcXD6GvbH3nWH5va0MMPSZ/TZDQebHkQVLKGF2KWWnBJC8V6D+b0X59 l9iiVvMoDKGOMFJOrbKGiQg0QnCSl1pw68CMeasC35aKi64K4d2U0l+7V7as7CF962 upkGfXTD5h+PNYrkeHHkdYxH8K8jU0jiVtIzb0w8= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110394] Lambda capture receives wrong value Date: Sat, 24 Jun 2023 16:33:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: WAITING 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: cc Message-ID: In-Reply-To: References: 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=3D110394 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xry111 at gcc dot gnu.org --- Comment #4 from Xi Ruoyao --- (In reply to Andrew Pinski from comment #3) > You can also try -fno-lifetime-dse to see if you get the behavior you were > expecting too. Though I am not sure it will help extend the lifetime of t= he > temporary here ... >=20 >=20 > https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Optimize-Options.html#index- > flifetime-dse -fstack-reuse=3Dnamed_vars maybe needed as well. -flifetime-dse preserves = the stores outside of the lifetime, and -fstack-reuse=3Dnamed_vars disallows re= using the stack space of the temporary object for other objects.=