From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9680 invoked by alias); 20 Nov 2013 17:54:28 -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 Received: (qmail 9644 invoked by uid 48); 20 Nov 2013 17:54:25 -0000 From: "Joost.VandeVondele at mat dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/59194] tsan detects race for real variables in an OMP reduction clause Date: Wed, 20 Nov 2013 17:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg02053.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59194 --- Comment #6 from Joost VandeVondele --- (In reply to Jakub Jelinek from comment #4) > I bet tsan complains because the load is > not atomic, but does it really matter? If we read garbage there, compare > and swap will fail and next time we'll have hopefully correct value already > from what compare and swap said was the previous value. Actually, I believe this might fail. If the garbage read happens to be equal to what a 3rd thread writes in the meanwhile (admittedly, small change), the compare and swap will succeed and not fail.