From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19974 invoked by alias); 17 Mar 2011 16:14:52 -0000 Received: (qmail 19957 invoked by uid 22791); 17 Mar 2011 16:14:50 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_DM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Mar 2011 16:14:47 +0000 From: "marcus.shawcroft at arm dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/48126] arm_output_sync_loop: misplaced memory barrier, missing clrex / dummy strex X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marcus.shawcroft at arm dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 17 Mar 2011 16:17:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg01888.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48126 Marcus Shawcroft changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marcus.shawcroft at arm dot | |com --- Comment #1 from Marcus Shawcroft 2011-03-17 16:14:36 UTC --- The code sequence in question looks like this: dmb sy 1: ldrex r0, ... cmp r0, r1 bne 2f strex r4, r2, .. teq r4, #0 bne 1b dmb sy 2: The ARM Architecture reference manual (section 3.4.5) requires that there are no explicit memory references between the LDREX and the STREX, this requirement does not extended to speculative loads in branch shadows. An LDREX without a following STREX is explicilty permitted by the reference manual (section 3.4.5). The CLREX instruction is provided for use by context switch code in order to prevent a false positive STREX following a context switch (section 3.4.4). The inclusion of a CLREX instruction in the above fragment is not required by the ARM architecture reference manual.