On 11/21/2011 07:42 AM, Michael Matz wrote: > __transaction_atomic > { > { > struct shared_count sc; > try > // ctor(&sc), dtor(&sc) > finally > { > sc = {CLOBBER}; > } > } > } > > later lowered to: > > <bb 3>: > __transaction_atomic // SUBCODE=[ GTMA_HAVE_STORE ] > <bb 4>: > // ctor(&sc),dtor(&sc) [tm-clone] > goto <bb 7>; > > <bb 7>: > sc ={v} {CLOBBER}; > __builtin__ITM_commitTransaction (); > > <bb 8>: > return 0; > > <L4>: > landing-pad > > The object 'sc' is constructed on the stack. Is it necessary to make it > transact? If not, then you can possibly improve code quality somewhat by > ignoring the clobbers also in requires_barrier (which then would need > changes to receive the whole statement, not just the lhs/rhs to determine > if this is an ignorable statement). I haven't tried this, though. The > patch below would be necessary anyway.
No, SC need not transact because it is already transaction-local. > PR other/51125 > * trans-mem.c (expand_block_tm): Ignore clobbers. Ok. r~