From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6603 invoked by alias); 3 Oct 2012 00:56:39 -0000 Received: (qmail 6578 invoked by uid 48); 3 Oct 2012 00:56:26 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/54786] Missing fence in std::atomic::store() triggers wrong reordering. Date: Wed, 03 Oct 2012 00:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 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-10/txt/msg00178.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54786 --- Comment #4 from Andrew Pinski 2012-10-03 00:56:25 UTC --- (In reply to comment #3) > I can confirm that it is fixed in 4.7.0, after the move to __atomic builtins, > at least on x86_64. It would be nice to have it fixed in currently hypothetical > 4.6.4, especially for those whose distro is stuck on 4.6. But at least it's > documented now and users can act accordingly. For example add > __sync_syncronise() or asm volatile ("":::"memory") before atomic::store(). Considering this is in an experimental part of the compiler (stdc++0x is consider experimental for 4.6), I say you are out of luck from support from the FSF. You can request your distro to have the fix backported though.