From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51F17384CB97; Wed, 15 May 2024 09:19:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51F17384CB97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715764764; bh=zwv1vOd5Q+ScFNL1ieB18DDAvosnY60Zkm1U5abzBCM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fbcYmugjAVLxRavcP52X0CRHE3Rp4feW5tr24IfEcSv4fcOu53cYMH2G10J7RNtIT ow57HJJ639IR0M6++83jrnJYl3JRKigxBzgu0+O180UWJFhmOLvJYm6vaCuqqakDgO 0jWzj2giei6Wla5+APoDxktMIjFaJ86wzd8Stpic= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/89624] HLE acquire/release bits in std::memory_order don't work with -fshort-enums or -fstrict-enums Date: Wed, 15 May 2024 09:19:23 +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: 9.0 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 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=3D89624 --- Comment #7 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:99dd1be14172445795f0012b935359e7014a2215 commit r15-502-g99dd1be14172445795f0012b935359e7014a2215 Author: Jonathan Wakely Date: Thu Apr 11 19:12:48 2024 +0100 libstdc++: Give std::memory_order a fixed underlying type [PR89624] Prior to C++20 this enum type doesn't have a fixed underlying type, which means it can be modified by -fshort-enums, which then means the HLE bits are outside the range of valid values for the type. As it has a fixed type of int in C++20 and later, do the same for earlier standards too. This is technically a change for C++17 down, because the implicit underlying type (without -fshort-enums) was unsigned before. I doubt it matters in practice. That incompatibility already exists between C++17 and C++20 and nobody has noticed or complained. Now at least the underlying type will be int for all -std modes. libstdc++-v3/ChangeLog: PR libstdc++/89624 * include/bits/atomic_base.h (memory_order): Use int as underlying type. * testsuite/29_atomics/atomic/89624.cc: New test.=