diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-12 18:50:16 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-12 18:50:16 +0000 |
commit | 86ff185365dbc40b64f907be9e2f35d756776e20 (patch) | |
tree | 578d5adc5ed91aadca2a5f5059f17c7211a8d514 /libgo/go/sync | |
parent | 966a140df68bf3e2d378fb9b68a8afb7d80b34d6 (diff) | |
download | gcc-86ff185365dbc40b64f907be9e2f35d756776e20.zip gcc-86ff185365dbc40b64f907be9e2f35d756776e20.tar.gz gcc-86ff185365dbc40b64f907be9e2f35d756776e20.tar.bz2 |
re PR go/84215 (Random results in go/libgo tests)
PR go/84215
runtime, sync/atomic: use write barrier for atomic pointer functions
This copies atomic_pointer.go from 1.10rc2. It was omitted during the
transition of the runtime from C to Go, and I forgot about it.
This may help with https://gcc.gnu.org/PR84215.
Reviewed-on: https://go-review.googlesource.com/93197
From-SVN: r257599
Diffstat (limited to 'libgo/go/sync')
-rw-r--r-- | libgo/go/sync/atomic/atomic.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/libgo/go/sync/atomic/atomic.c b/libgo/go/sync/atomic/atomic.c index 32cbf03..07a4306 100644 --- a/libgo/go/sync/atomic/atomic.c +++ b/libgo/go/sync/atomic/atomic.c @@ -62,16 +62,6 @@ SwapUintptr (uintptr_t *addr, uintptr_t new) return __atomic_exchange_n (addr, new, __ATOMIC_SEQ_CST); } -void *SwapPointer (void **, void *) - __asm__ (GOSYM_PREFIX "sync_atomic.SwapPointer") - __attribute__ ((no_split_stack)); - -void * -SwapPointer (void **addr, void *new) -{ - return __atomic_exchange_n (addr, new, __ATOMIC_SEQ_CST); -} - _Bool CompareAndSwapInt32 (int32_t *, int32_t, int32_t) __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapInt32") __attribute__ ((no_split_stack)); @@ -126,16 +116,6 @@ CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new) return __sync_bool_compare_and_swap (val, old, new); } -_Bool CompareAndSwapPointer (void **, void *, void *) - __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapPointer") - __attribute__ ((no_split_stack)); - -_Bool -CompareAndSwapPointer (void **val, void *old, void *new) -{ - return __sync_bool_compare_and_swap (val, old, new); -} - int32_t AddInt32 (int32_t *, int32_t) __asm__ (GOSYM_PREFIX "sync_atomic.AddInt32") __attribute__ ((no_split_stack)); @@ -357,17 +337,3 @@ StoreUintptr (uintptr_t *addr, uintptr_t val) while (! __sync_bool_compare_and_swap (addr, v, val)) v = *addr; } - -void StorePointer (void **addr, void *val) - __asm__ (GOSYM_PREFIX "sync_atomic.StorePointer") - __attribute__ ((no_split_stack)); - -void -StorePointer (void **addr, void *val) -{ - void *v; - - v = *addr; - while (! __sync_bool_compare_and_swap (addr, v, val)) - v = *addr; -} |