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.