From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1DE9E3857714; Thu, 27 Apr 2023 14:43:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DE9E3857714 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682606636; bh=7B49/5pH4UWa9S17Kv3H4RI7Z62bli/r5+IaVdkO7Bo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Z003PNBMTldu2tG8zdjrmibf2HwpkOMvpOtsOjQqjXI8jUewL9JZDFJaygRZYs5Xx QvbFheKZzHpNcTud420qQLT4at/yI73to006ycI7bV4xarXuFDjYTAiJFJOiCSMue3 JsGZaF7q1MJM3MQoBH8WfFTTiharVE/3+vAfPgjY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/109339] [12 Regression] stop_token compiled with -Og yields maybe-uninitialized Date: Thu, 27 Apr 2023 14:43:55 +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 #14 from CVS Commits --- The releases/gcc-12 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:47880309516fd5c913102eb4c52dc86da7051983 commit r12-9486-g47880309516fd5c913102eb4c52dc86da7051983 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. (cherry picked from commit a35e8042fbc7a3eb9cece1fba4cdd3b6cdfb906f)=