From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0E2CB384840D; Fri, 31 Mar 2023 14:50:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E2CB384840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680274205; bh=sSm7Fe0EPHREyJxLP7glAMiOoAg7VQ9ETQn+c37lPVw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rDam/u0NxGvjx50AI6sSVeWgEpdomh8MsRbSd0l9ZYvpmwrY1b5vFWZpeRpLc5w0y Gb3Fn2xcRLec/eNUoIm9sUpB9YPwqT+4DyJvneER/gLwRpjNF9+noicbwVcpjmRozR DNc80fQmwleC/KI1gxzlY69jf/Mb5fFfBVDw+/Uc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/109339] [12/13 Regression] stop_token compiled with -Og yields maybe-uninitialized Date: Fri, 31 Mar 2023 14:50:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109339 --- Comment #12 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:a35e8042fbc7a3eb9cece1fba4cdd3b6cdfb906f commit r13-6958-ga35e8042fbc7a3eb9cece1fba4cdd3b6cdfb906f Author: Jonathan Wakely Date: Fri Mar 31 13:38:14 2023 +0100 libstdc++: Avoid -Wmaybe-uninitialized warning in std::stop_source [PR109339] We pass a const-reference to *this before it's constructed, and GCC assumes that all const-references are accessed. Add the access attribute to say it's not accessed. libstdc++-v3/ChangeLog: PR libstdc++/109339 * include/std/stop_token (_Stop_state_ptr(const stop_source&)): Add attribute access with access-mode 'none'. * testsuite/30_threads/stop_token/stop_source/109339.cc: New te= st.=