This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/51752] trans-mem: publication safety violated
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Feb 2012 16:43:40 +0000
- Subject: [Bug middle-end/51752] trans-mem: publication safety violated
- Auto-submitted: auto-generated
- References: <bug-51752-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51752
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 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).
<bb 2>:
# .MEM_2 = VDEF <.MEM_1(D)>
data = 23;
__transaction_atomic // SUBCODE=[ GTMA_HAVE_STORE ]
<bb 3>:
# .MEM_3 = VDEF <.MEM_2>
x[9] = 1;
# .MEM_4 = VDEF <.MEM_3>
__builtin__ITM_commitTransaction ();
<bb 4>:
# 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.