From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7BDAE3840C3D; Thu, 11 Jun 2020 12:23:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BDAE3840C3D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591878185; bh=RPhDGc7cGIblXkr9XceZf5GB/U/haXSUMo/xIlIjps4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yI7uGsOgqpNtQWhkDLh90mLYw7p357yHjvFrmmtvHotw6N5+TDdG3P0B7kNK8L3wo Kl2OpAxByOKbfSkeA1JHnIZgiWi21OnKLFBFVL31FhHUKER5ZNO2EsCz8BxM457y8L 2yriGC2Sud862aCvf8xo61Ew9HVhKavrTClwL7lk= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95638] Legit-looking code doesn't work with -O2 Date: Thu, 11 Jun 2020 12:23:05 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 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 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: Thu, 11 Jun 2020 12:23:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95638 --- Comment #3 from Jakub Jelinek --- (In reply to Martin Li=C5=A1ka from comment #2) > The code works with -flifetime-dse=3D1, so I bet there's some object that= goes > out of life: > https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html > https://gcc.gnu.org/gcc-6/porting_to.html#flifetime-dse The difference between -flifetime-dse=3D1 and the default is not in uses af= ter end of scope, but in relying on content being defined across start of the constructor.=