From patchwork Sat Mar 16 13:29:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 228211 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3F49C2C00B3 for ; Sun, 17 Mar 2013 00:31:04 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1364045464; h=Comment: DomainKey-Signature:Received:Received:Received:Received:From:To: Cc:Subject:Date:Message-Id:In-Reply-To:References:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=ejm1TXmgRvXq65gkIErnHM2Jl0Q=; b=fQm6rjGRtFv3lRasBekdqdtvXDHEGfPNzZr2mWXe6ew+w4biej3A79JdDFr4VH Uz6xOByDSul+UghtvpTt3OOELlCLPzELLSDR5VcOi+JF3B+r48vaQk7E2SHvEBOw EmlSQ8XK2EpOnpnJS8G6jCOQEwxu1e6G0dhM3OSzJFsVY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=M9wW+4za5g+o40jb4t8vLABB+510bYIqHDCJaWMdLt9SbMNu1E3R4WSzuIDv7R cWAc0HJ76a6YZyC4aBIssmlquRiw8Ljzynrf3TS0gzWDeFyXFreVlYxi5uKEbyME t/VEpshoSIHxENRNgN6HBAYL1JcqvInsMbbOaoA4SSa/o=; Received: (qmail 8431 invoked by alias); 16 Mar 2013 13:29:56 -0000 Received: (qmail 8394 invoked by uid 22791); 16 Mar 2013 13:29:54 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from two.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Mar 2013 13:29:48 +0000 Received: by one.firstfloor.org (Postfix, from userid 503) id 56B0A86757; Sat, 16 Mar 2013 14:29:43 +0100 (CET) From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, rth@redhat.com, Andi Kleen Subject: [PATCH 2/4] Avoid non constant memory model uses in libatomic Date: Sat, 16 Mar 2013 14:29:27 +0100 Message-Id: <1363440569-17331-2-git-send-email-andi@firstfloor.org> In-Reply-To: <1363440569-17331-1-git-send-email-andi@firstfloor.org> References: <1363440569-17331-1-git-send-email-andi@firstfloor.org> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org From: Andi Kleen x86 ends up using non constant memory models for some of the libatomic functions. These all end up as __ATOMIC_SEQ_CST. Just use this directly. This avoids a new warning for non constant memory models, which broke the bootstrap with -Werror Passed bootstrap and test on x86_64-linux. libatomic/: 2013-03-15 Andi Kleen * gcas.c: (EXACT_INLINE): Use __ATOMIC_SEQ_CST. * gexch.c: (EXACT_INLINE): Use __ATOMIC_SEQ_CST. * gload.c: (EXACT_INLINE): Use __ATOMIC_SEQ_CST. * gstore.c: (EXACT_INLINE): Use __ATOMIC_SEQ_CST. diff --git a/libatomic/gcas.c b/libatomic/gcas.c index edbf611..e3d77f3 100644 --- a/libatomic/gcas.c +++ b/libatomic/gcas.c @@ -32,7 +32,7 @@ # define EXACT_INLINE(N) \ if (C2(HAVE_ATOMIC_CAS_,N)) \ return __atomic_compare_exchange_n \ - (PTR(N,mptr), PTR(N,eptr), *PTR(N,dptr), false, smodel, fmodel) + (PTR(N,mptr), PTR(N,eptr), *PTR(N,dptr), false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) #else # define EXACT_INLINE(N) #endif diff --git a/libatomic/gexch.c b/libatomic/gexch.c index 1999067..c8c8658 100644 --- a/libatomic/gexch.c +++ b/libatomic/gexch.c @@ -33,7 +33,7 @@ if (C2(HAVE_ATOMIC_EXCHANGE_,N)) \ { \ *PTR(N,rptr) = __atomic_exchange_n \ - (PTR(N,mptr), *PTR(N,vptr), smodel); \ + (PTR(N,mptr), *PTR(N,vptr), __ATOMIC_SEQ_CST); \ return; \ } #else diff --git a/libatomic/gload.c b/libatomic/gload.c index df318d5..85865bd 100644 --- a/libatomic/gload.c +++ b/libatomic/gload.c @@ -32,7 +32,7 @@ # define EXACT_INLINE(N, DEST, SRC, DONE) \ if (C2(HAVE_ATOMIC_LDST_,N)) \ { \ - DEST = __atomic_load_n (SRC, smodel); \ + DEST = __atomic_load_n (SRC, __ATOMIC_SEQ_CST); \ DONE; \ } #else diff --git a/libatomic/gstore.c b/libatomic/gstore.c index d571e58..84f9a8d 100644 --- a/libatomic/gstore.c +++ b/libatomic/gstore.c @@ -32,7 +32,7 @@ # define EXACT_INLINE(N) \ if (C2(HAVE_ATOMIC_LDST_,N)) \ { \ - __atomic_store_n (PTR(N,mptr), *PTR(N,vptr), smodel); \ + __atomic_store_n (PTR(N,mptr), *PTR(N,vptr), __ATOMIC_SEQ_CST); \ return; \ } #else --- libatomic/gcas.c | 2 +- libatomic/gexch.c | 2 +- libatomic/gload.c | 2 +- libatomic/gstore.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libatomic/gcas.c b/libatomic/gcas.c index edbf611..e3d77f3 100644 --- a/libatomic/gcas.c +++ b/libatomic/gcas.c @@ -32,7 +32,7 @@ # define EXACT_INLINE(N) \ if (C2(HAVE_ATOMIC_CAS_,N)) \ return __atomic_compare_exchange_n \ - (PTR(N,mptr), PTR(N,eptr), *PTR(N,dptr), false, smodel, fmodel) + (PTR(N,mptr), PTR(N,eptr), *PTR(N,dptr), false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) #else # define EXACT_INLINE(N) #endif diff --git a/libatomic/gexch.c b/libatomic/gexch.c index 1999067..c8c8658 100644 --- a/libatomic/gexch.c +++ b/libatomic/gexch.c @@ -33,7 +33,7 @@ if (C2(HAVE_ATOMIC_EXCHANGE_,N)) \ { \ *PTR(N,rptr) = __atomic_exchange_n \ - (PTR(N,mptr), *PTR(N,vptr), smodel); \ + (PTR(N,mptr), *PTR(N,vptr), __ATOMIC_SEQ_CST); \ return; \ } #else diff --git a/libatomic/gload.c b/libatomic/gload.c index df318d5..85865bd 100644 --- a/libatomic/gload.c +++ b/libatomic/gload.c @@ -32,7 +32,7 @@ # define EXACT_INLINE(N, DEST, SRC, DONE) \ if (C2(HAVE_ATOMIC_LDST_,N)) \ { \ - DEST = __atomic_load_n (SRC, smodel); \ + DEST = __atomic_load_n (SRC, __ATOMIC_SEQ_CST); \ DONE; \ } #else diff --git a/libatomic/gstore.c b/libatomic/gstore.c index d571e58..84f9a8d 100644 --- a/libatomic/gstore.c +++ b/libatomic/gstore.c @@ -32,7 +32,7 @@ # define EXACT_INLINE(N) \ if (C2(HAVE_ATOMIC_LDST_,N)) \ { \ - __atomic_store_n (PTR(N,mptr), *PTR(N,vptr), smodel); \ + __atomic_store_n (PTR(N,mptr), *PTR(N,vptr), __ATOMIC_SEQ_CST); \ return; \ } #else