From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE92E3858C33; Sat, 19 Aug 2023 19:36:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE92E3858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692473779; bh=472rzWCm6gO1EGMjraZNV3H+Y9o3Rsf1USO/8gqhdm4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jm3nui4fv3/Ptgse1XbjDENv9bOfNyKhRludNi06bP6gn3dAbTMZ9ivTZW3iIdiLR P7Q3t5QXyIQ+jLZZHb5Oy6A0NwetXozPbERdGK8908vp4wWlAfVqlNDFHFqO3Q7ACs VVup2BHzgG0Y/30s59JCFgm66HaONs/E1t3GP+yk= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111077] atomic_ref compare_exchange_strong doesn't properly ignore padding bits Date: Sat, 19 Aug 2023 19:36:19 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: component 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=3D111077 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|libstdc++ |c++ --- Comment #1 from Andrew Pinski --- The calls for clearing the padding are there before eiline: ``` std::__atomic_impl::__clear_padding (__exp_28); _4 =3D (int) __is_weak_30(D); _5 =3D std::__atomic_impl::__clear_padding (__i_31(D)= ); _6 =3D VIEW_CONVERT_EXPR(*_5); _7 =3D std::__addressof (__val_33(D)); retval.11_37 =3D __atomic_compare_exchange_4 (_7, __exp_28, _6, _4, __s_3= 5(D), __f_16(D)); ``` Oh we are not clearing the padding of the reference ... Is this even well defined?=