From patchwork Tue Dec 13 20:21:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 131184 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 8BDD11007D3 for ; Wed, 14 Dec 2011 07:22:05 +1100 (EST) Received: (qmail 4560 invoked by alias); 13 Dec 2011 20:22:01 -0000 Received: (qmail 4544 invoked by uid 22791); 13 Dec 2011 20:22:00 -0000 X-SWARE-Spam-Status: No, hits=-7.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 20:21:46 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBDKLjZ9013141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2011 15:21:45 -0500 Received: from anchor.twiddle.home (vpn-9-230.rdu.redhat.com [10.11.9.230]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBDKLhZO006364; Tue, 13 Dec 2011 15:21:44 -0500 Message-ID: <4EE7B3D7.9050405@redhat.com> Date: Tue, 13 Dec 2011 12:21:43 -0800 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Dominique Dhumieres CC: gcc-patches@gcc.gnu.org Subject: Re: [RFC][libitm] Convert to c++11 atomics References: <20111213194334.C58A03BE18@mailhost.lps.ens.fr> In-Reply-To: <20111213194334.C58A03BE18@mailhost.lps.ens.fr> X-IsSubscribed: yes 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 On 12/13/2011 11:43 AM, Dominique Dhumieres wrote: >> I've committed the patch. > > It caused: > > ../../../work/libitm/config/posix/rwlock.cc: In member function 'bool GTM::gtm_rwlock::write_lock_generic(GTM::gtm_thread*)': > ../../../work/libitm/config/posix/rwlock.cc:196:56: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] > cc1plus: all warnings being treated as errors Fixed. Tested on linux with --disable-linux-futex. r~ Index: libitm/ChangeLog =================================================================== --- libitm/ChangeLog (revision 182301) +++ libitm/ChangeLog (working copy) @@ -1,5 +1,8 @@ 2011-12-13 Richard Henderson + * config/posix/rwlock.cc (gtm_rwlock::write_lock_generic): Fix + signed/unsigned comparison werror. + * local_atomic: New file. * libitm_i.h: Include it. (gtm_thread::shared_state): Use atomic template. Index: libitm/config/posix/rwlock.cc =================================================================== --- libitm/config/posix/rwlock.cc (revision 182301) +++ libitm/config/posix/rwlock.cc (working copy) @@ -193,7 +193,7 @@ it = it->next_thread) { // Don't count ourself if this is an upgrade. - if (it->shared_state.load(memory_order_relaxed) != -1) + if (it->shared_state.load(memory_order_relaxed) != (gtm_word)-1) readers++; }