From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5717 invoked by alias); 10 Jan 2012 14:49:41 -0000 Received: (qmail 5700 invoked by uid 22791); 10 Jan 2012 14:49:39 -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; Tue, 10 Jan 2012 14:49:27 +0000 From: "rguenth 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: Tue, 10 Jan 2012 14:49: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: rguenth 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/msg01017.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51766 --- Comment #6 from Richard Guenther 2012-01-10 14:48:54 UTC --- (In reply to comment #5) > I understand that fixing __sync_* is a hassle. This is why I opened a separate > bug for libstdc++. > > While __sync_* is deprecated in favor of __atomic_*, use of __sync_* for > portability is fairly pervasive in FOSS applications that need it because of > its implementation in GCC. Most programmers do not know about memory models > and do not care about memory models. And it will take time for programmers to > switch to __atomic_*, if they even bother to choose a memory model and don't > introduce a bug. > > The basic problem is MEMMODEL_SEQ_CST only makes a performance difference for > POWER and developers are going to continue to use __sync_* builtins for a > while. This change in default behavior only hurts performance for applications > on POWER relative to all other architectures, which sucks. :-( Yes, I see that. But my question is - did a developer reading the documentation get _correct_ code on POWER (which uses a laxer memory model than documented!) in all cases? Or can you construct a testcase that works fine on IA64 while surprisingly (after reading docs) does not work on POWER? Thus, didn't we simply fix a wrong-code bug (albeit by producing slower code)?