From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 78EC33844036; Tue, 6 Apr 2021 20:35:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78EC33844036 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/88897] Bogus maybe-uninitialized warning on class field (missed CSE) Date: Tue, 06 Apr 2021 20:35:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 8.2.1 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW 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 cf_known_to_fail cf_reconfirmed_on 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: Tue, 06 Apr 2021 20:35:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D88897 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org Known to fail| |10.2.0, 11.0, 8.3.0, 9.3.0 Last reconfirmed|2019-01-22 00:00:00 |2021-4-6 --- Comment #7 from Martin Sebor --- The IL hasn't appreciably changed in GCC 11 so it still issues the warning, albeit with more detail. $ gcc -O2 -S -Wall pr88897.C In constructor =E2=80=98temporary_buffer::temporary_buffer(temporary_buffer= &&)=E2=80=99, inlined from =E2=80=98optional::optional(optional&&)=E2=80=99 at pr8889= 7.C:22:79, inlined from =E2=80=98void foo()=E2=80=99 at pr88897.C:42:57: pr88897.C:14:63: warning: =E2=80=98*(temporary_buffer*)((char*)&_local_stat= e + offsetof(future_state, future_state::value.optional::)).temporary_buffer::_buffer=E2=80= =99 may be used uninitialized [-Wmaybe-uninitialized] 14 | temporary_buffer(temporary_buffer &&x) noexcept : _buffer(x._buffe= r) { | ~~^~~~~~~ pr88897.C: In function =E2=80=98void foo()=E2=80=99: pr88897.C:40:16: note: =E2=80=98_local_state=E2=80=99 declared here 40 | future_state _local_state; | ^~~~~~~~~~~~=