http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51766
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-10 15:29:09 UTC --- (In reply to comment #3) > > It says above them "In most cases, these > > builtins are considered a full barrier." and only __sync_lock_test_and_set > > and > > __sync_lock_release specify different barrier semantics. > > The next sentence is: > > "That is, no memory operand will be moved across the operation, either forward > or > backward." It continues: "Further, instructions will be issued as necessary to prevent the processor from speculating loads across the operation and from queuing stores after the operation." Doesn't that rule out lwsync, which allows loads to be moved to before the store preceding the lwsync? Isn't the fact users will continue to use the __sync builtins all the more reason they should work as documented?