From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9087 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: atomic.h cleanup Date: Sun, 10 Jan 2016 20:50:28 +0300 (MSK) Message-ID: References: <20160110122139.GF2016@debian> <20160110165718.GR238@brightrain.aerifal.cx> <20160110173509.GG2016@debian> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1452448243 23173 80.91.229.3 (10 Jan 2016 17:50:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2016 17:50:43 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9100-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jan 10 18:50:43 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aIK8Y-0000Dv-1c for gllmg-musl@m.gmane.org; Sun, 10 Jan 2016 18:50:42 +0100 Original-Received: (qmail 32577 invoked by uid 550); 10 Jan 2016 17:50:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 32556 invoked from network); 10 Jan 2016 17:50:39 -0000 In-Reply-To: <20160110173509.GG2016@debian> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) Xref: news.gmane.org gmane.linux.lib.musl.general:9087 Archived-At: On Sun, 10 Jan 2016, Markus Wichmann wrote: > | static inline int a_sc(volatile int* p, int x) > | { > | __asm__ goto ("stwcx. %0, 0, %1\n\tbne- %l2" : : "r"(x), "r"(p) : "cc", "memory" : fail); > | return 1; > | fail: > | return 0; > | } > > I tested the assembler output from both gcc and clang and it looks > alright to me (testcase attached). "asm goto" is an extension that appeared in gcc 4.5 and is not supported in clang (I get "error: expected '(' after 'asm'" with clang 3.7). I don't know why you claim it works with clang. Corresponding llvm bugs (no plans to add support soon): https://llvm.org/bugs/show_bug.cgi?id=9295 https://llvm.org/bugs/show_bug.cgi?id=14406 Alexander