From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31247 invoked by alias); 12 Oct 2011 00:44:28 -0000 Received: (qmail 31235 invoked by uid 22791); 12 Oct 2011 00:44:27 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Oct 2011 00:44:14 +0000 Received: by ggnq1 with SMTP id q1so187815ggn.20 for ; Tue, 11 Oct 2011 17:44:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.36.232 with SMTP id t8mr50047918pbj.54.1318380253601; Tue, 11 Oct 2011 17:44:13 -0700 (PDT) Received: by 10.68.62.10 with HTTP; Tue, 11 Oct 2011 17:44:13 -0700 (PDT) In-Reply-To: <20111006175237.GC12770@davesworkthinkpad> References: <20110701155254.GA5242@davesworkthinkpad> <20110726085910.GA6925@davesworkthinkpad> <20110726090039.GB6925@davesworkthinkpad> <20111006174941.GA12770@davesworkthinkpad> <20111006175124.GB12770@davesworkthinkpad> <20111006175237.GC12770@davesworkthinkpad> Date: Wed, 12 Oct 2011 00:52:00 -0000 Message-ID: Subject: Re: [Patch 2/5] ARM 64 bit sync atomic operations [V3] From: Ramana Radhakrishnan To: "Dr. David Alan Gilbert" Cc: gcc-patches@gcc.gnu.org, rth@redhat.com, joseph@codesourcery.com, patches@linaro.org, mikestump@comcast.net, ro@cebitec.uni-bielefeld.de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00944.txt.bz2 On 6 October 2011 18:52, Dr. David Alan Gilbert wrote: > =A0 =A0 =A0 =A0Micahel K. Edwards points out in PR/48126 that the sync is= in the wrong place > =A0 =A0 =A0 =A0relative to the branch target of the compare, since the lo= ad could float > =A0 =A0 =A0 =A0up beyond the ldrex. > > =A0 =A0 =A0 =A0PR target/48126 > > =A0 =A0 =A0 =A0 =A0* config/arm/arm.c (arm_output_sync_loop): Move label = before barrier > > diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c > index 5161439..6e7105a 100644 > --- a/gcc/config/arm/arm.c > +++ b/gcc/config/arm/arm.c > @@ -24214,8 +24214,11 @@ arm_output_sync_loop (emit_f emit, > =A0 =A0 =A0 =A0} > =A0 =A0 } > > - =A0arm_process_output_memory_barrier (emit, NULL); > + =A0/* Note: label is before barrier so that in cmp failure case we stil= l get > + =A0 =A0 a barrier to stop subsequent loads floating upwards past the ld= rex > + =A0 =A0 pr/48126. =A0*/ > =A0 arm_output_asm_insn (emit, 1, operands, "%sLSYB%%=3D:", LOCAL_LABEL_P= REFIX); > + =A0arm_process_output_memory_barrier (emit, NULL); > =A0} > > =A0static rtx > OK. Ramana