On Mon, Jun 22, 2015 at 10:48 AM, Matthew Wahab <matthew.wa...@arm.com> wrote: > This is the ARM version of the patches to strengthen memory barriers for the > __sync builtins on ARMv8 targets > (https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01989.html). > > The problem is that the barriers generated for the __sync builtins for ARMv8 > targets are too weak. This affects the full and the acquire barriers in the > __sync fetch-and-op, compare-and-swap functions and > __sync_lock_test_and_set. > > This patch series changes the code to strengthen the barriers by replacing > initial load-acquires with a simple load and adding a final memory barrier > to > prevent code hoisting. > > - Full barriers: __sync_fetch_and_op, __sync_op_and_fetch > __sync_*_compare_and_swap > > [load-acquire; code; store-release] > becomes > [load; code ; store-release; barrier]. > > - Acquire barriers: __sync_lock_test_and_set > > [load-acquire; code; store] > becomes > [load; code; store; barrier] > > This patch changes the code generated for __sync_fetch_and_<op> and > __sync_<op>_and_fetch builtins. > > Tested as part of a series for arm-none-linux-gnueabihf with check-gcc. > > Ok for trunk? > Matthew > > gcc/ > 2015-06-22 Matthew Wahab <matthew.wa...@arm.com> > > PR Target/65697
s/Target/target > * config/armc/arm.c (arm_split_atomic_op): For ARMv8, replace an > initial acquire barrier with a final full barrier. Otherwise OK. Ramana