Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AO_compare_and_swap_full asm code for clang on sparc
Issue #52 (libatomic_ops). The issue (SIGSEGV in test_malloc) is observed with clang-13, at least. The workaround is to simplify asm code of AO_compare_and_swap_full (moving the comparison of CAS result and old value to C code). * src/atomic_ops/sysdeps/gcc/sparc.h [(!(AO_GNUC_PREREQ(12,0) || AO_CLANG_PREREQ(13,0)) || AO_DISABLE_GCC_ATOMICS) && !AO_NO_SPARC_V9 && !AO_GENERALIZE_ASM_BOOL_CAS] (AO_compare_and_swap_full): Remove ret local variable; remove cmp, be, mov, clr instructions from asm block (to match that of AO_fetch_compare_and_swap_full); remove cc from asm block clobbers; change specifier for old input operand of asm block (from "0" to "r"); return new_val==old instead of ret.
- Loading branch information