From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12862 invoked by alias); 9 Feb 2012 16:44:53 -0000 Received: (qmail 12793 invoked by uid 22791); 9 Feb 2012 16:44:52 -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; Thu, 09 Feb 2012 16:44:39 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/51752] trans-mem: publication safety violated Date: Thu, 09 Feb 2012 16:44: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: P3 X-Bugzilla-Assigned-To: aldyh at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.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-02/txt/msg00956.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51752 --- Comment #4 from Richard Guenther 2012-02-09 16:43:40 UTC --- But isn't with __transaction_atomic { for (i = 0; i < 10; i++) if (x[i]) x[i] += data; } and __transaction_atomic { x[9] = 1; } occuring concurrently the loop transaction terminated? Thus, __transaction_atomic { tem = data; for (i = 0; i < 10; i++) if (x[i]) x[i] += tem; } equivalent? We don't hoist out of the transaction region (well, as far as I can see - the transaction region seems to be specified in a very weak way, without virtual operands or any IL barrier or such). : # .MEM_2 = VDEF <.MEM_1(D)> data = 23; __transaction_atomic // SUBCODE=[ GTMA_HAVE_STORE ] : # .MEM_3 = VDEF <.MEM_2> x[9] = 1; # .MEM_4 = VDEF <.MEM_3> __builtin__ITM_commitTransaction (); : # VUSE <.MEM_4> return; the __transaction_atomic // SUBCODE=[ GTMA_HAVE_STORE ] statement looks like an overly optimistic way to start a transaction in my quick view.