From 2daf685b7dec61f9e9b3e9cc208cbd1c31fb8b92 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 17 Aug 2013 15:05:36 +0400 Subject: [PATCH] Do not use LDREXD/STREXD for Clang3.2/arm (and earlier) * src/atomic_ops/sysdeps/gcc/arm.h (AO_ARM_HAVE_LDREXD): Do not define for pre-Clang3.3 (since it does not allocate register pairs for LDREXD/STREXD instructions properly); add comment. --- src/atomic_ops/sysdeps/gcc/arm.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/atomic_ops/sysdeps/gcc/arm.h b/src/atomic_ops/sysdeps/gcc/arm.h index 874ed07..c19f6da 100644 --- a/src/atomic_ops/sysdeps/gcc/arm.h +++ b/src/atomic_ops/sysdeps/gcc/arm.h @@ -62,12 +62,16 @@ /* DMB is present in ARMv6M and ARMv7+. */ # define AO_ARM_HAVE_DMB # endif -# if !defined(__thumb__) \ - || (defined(__thumb2__) && !defined(__ARM_ARCH_7__) \ - && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__)) +# if (!defined(__thumb__) \ + || (defined(__thumb2__) && !defined(__ARM_ARCH_7__) \ + && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__))) \ + && (!defined(__clang__) || (__clang_major__ > 3) \ + || (__clang_major__ == 3 && __clang_minor__ >= 3)) /* LDREXD/STREXD present in ARMv6K/M+ (see gas/config/tc-arm.c). */ /* In the Thumb mode, this works only starting from ARMv7 (except */ - /* for the base and 'M' models). */ + /* for the base and 'M' models). Clang3.2 (and earlier) does not */ + /* allocate register pairs for LDREXD/STREXD properly (besides, */ + /* Clang3.1 does not support "%H" operand specification). */ # define AO_ARM_HAVE_LDREXD # endif /* !thumb || ARMv7A || ARMv7R+ */ # endif /* ARMv7+ */ -- 2.7.4