From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EAFF3858C60; Sun, 19 Mar 2023 13:57:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EAFF3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679234259; bh=IIxKp9uH5jm1ZpGUh7iQWyLHn8CARnCvMsWC98a/SWQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=idO5EA0LlcB2A61PaW6EXr+jYjlNJu6WuL4AfKHg9WluXhBGD8Pi8zfEX9glfHsSe WvaEzNP7cFQG5I2+5hN3F6H6cRVAkp8TxIs3Ywo+WGPm+64XMfbAwvh3y/rrXi48/s khEIJlu8Y+Fjbac7nCBp3m1iFBjzWe817uJt8W40= From: "jdx at o2 dot pl" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109166] Built-in __atomic_test_and_set does not seem to be atomic on ARMv4T Date: Sun, 19 Mar 2023 13:57:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jdx at o2 dot pl 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: 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=3D109166 --- Comment #5 from Jan Dubiec --- I read that thread a few days ago and I understand concerns regarding SWP, = in particular on ARMv6 which has made SWP obsolete (AFAIR it is optional on ARMv6-A/R, ARMv6-M has neither SWP nor LDREX/STREX). However I have never h= eard of an ARMv4T based MCU which does not have SWP. So I do not understand why = gcc targeting various "bare metal" ARMs for ARMv4T a) emits non-atomic __atomic_test_and_set, b) does not use SWP in that code. Especially that the code attached to the linked message for ARMv4T uses SWP.=