From 22b5604f9af0f307fae797a0b8204314e26f88a1 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Mon, 24 Aug 2020 21:31:13 +0000 Subject: Fix size of local variable passed to cas[x] (gcc/sparc) Use the same type for input and output inline asm operands in AO_compare_and_swap_full(). * src/atomic_ops/sysdeps/gcc/sparc.h [!AO_NO_SPARC_V9 && !AO_GENERALIZE_ASM_BOOL_CAS] (AO_compare_and_swap_full): Change type of ret local variable from char to AO_t. --- src/atomic_ops/sysdeps/gcc/sparc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atomic_ops/sysdeps/gcc/sparc.h b/src/atomic_ops/sysdeps/gcc/sparc.h index 41bc2f5..27ef50f 100644 --- a/src/atomic_ops/sysdeps/gcc/sparc.h +++ b/src/atomic_ops/sysdeps/gcc/sparc.h @@ -42,7 +42,7 @@ AO_test_and_set_full(volatile AO_TS_t *addr) { /* Returns nonzero if the comparison succeeded. */ AO_INLINE int AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) { - char ret; + AO_t ret; __asm__ __volatile__ ("membar #StoreLoad | #LoadLoad\n\t" # if defined(__arch64__) "casx [%2],%0,%1\n\t" -- cgit v1.2.1