From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14906 invoked by alias); 9 Jan 2012 15:45:41 -0000 Received: (qmail 14823 invoked by uid 22791); 9 Jan 2012 15:45:38 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Mon, 09 Jan 2012 15:45:08 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/51766] [4.7 regression] sync_fetch_and_xxx atomicity Date: Mon, 09 Jan 2012 15:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: 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 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: 2012-01/txt/msg00884.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51766 --- Comment #2 from Jonathan Wakely 2012-01-09 15:45:06 UTC --- (In reply to comment #1) > The docs of __sync_* say > > This builtin is not a full barrier, but rather an @dfn{acquire barrier}. > This means that references after the builtin cannot move to (or be > speculated to) before the builtin, but previous memory stores may not > be globally visible yet, and previous memory loads may not yet be > satisfied. > > But it is not exactly clear to which builtins this applies. Thus, is > the intended behavior actually target depedent? It refers to __sync_lock_test_and_set only (it says "this builtin" and follows that one) And "This builtin is not a full barrier, but rather a release barrier." refers to __sync_lock_release. All the others are full barriers. It says above them "In most cases, these builtins are considered a full barrier." and only __sync_lock_test_and_set and __sync_lock_release specify different barrier semantics.