diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-10-27 23:47:56 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-10-27 23:47:56 +0000 |
commit | 8f82f28bbaa6ca503e6296b2d26ecf213bceff88 (patch) | |
tree | 075ed37973747822325b5a45ceb4bf12518d6045 /sysdeps/mips | |
parent | f1d237df1eec1df8cbc34f95540fd4035776e79c (diff) | |
download | glibc-8f82f28bbaa6ca503e6296b2d26ecf213bceff88.tar.gz |
Remove MIPS16 atomics using __sync_* (bug 17404).
MIPS16 atomics used __sync_* with GCC before 4.7, which as noted in
bug 17404 is missing the required barrier semantics for
atomic_exchange_rel. This patch removes the code in question as dead
now GCC before 4.7 is no longer supported for building glibc.
Sanity tested with builds for MIPS.
[BZ #17404]
* sysdeps/mips/atomic-machine.h
[__GNUC_PREREQ (4, 8) || (__mips16 && __GNUC_PREREQ (4, 7))]:
Change conditional to [__GNUC_PREREQ (4, 8) || __mips16].
[__mips16 && !__GNUC_PREREQ (4, 7)]: Remove conditional code.
Diffstat (limited to 'sysdeps/mips')
-rw-r--r-- | sysdeps/mips/atomic-machine.h | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/sysdeps/mips/atomic-machine.h b/sysdeps/mips/atomic-machine.h index 6db8fee1d4..f0a8902590 100644 --- a/sysdeps/mips/atomic-machine.h +++ b/sysdeps/mips/atomic-machine.h @@ -85,7 +85,7 @@ typedef uintmax_t uatomic_max_t; #define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X) #define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC) -#if __GNUC_PREREQ (4, 8) || (defined __mips16 && __GNUC_PREREQ (4, 7)) +#if __GNUC_PREREQ (4, 8) || defined __mips16 /* The __atomic_* builtins are available in GCC 4.7 and later, but MIPS support for their efficient implementation was added only in GCC 4.8. We still want to use them even with GCC 4.7 for MIPS16 code where we @@ -213,31 +213,6 @@ typedef uintmax_t uatomic_max_t; __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ __ATOMIC_RELEASE) -#elif defined __mips16 /* !__GNUC_PREREQ (4, 7) */ -/* This implementation using __sync* builtins will be removed once glibc - requires GCC 4.7 or later to build. */ - -# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ - __sync_val_compare_and_swap ((mem), (oldval), (newval)) -# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ - (!__sync_bool_compare_and_swap ((mem), (oldval), (newval))) - -# define atomic_exchange_acq(mem, newval) \ - __sync_lock_test_and_set ((mem), (newval)) - -# define atomic_exchange_and_add(mem, val) \ - __sync_fetch_and_add ((mem), (val)) - -# define atomic_bit_test_set(mem, bit) \ - ({ __typeof (bit) __bit = (bit); \ - (__sync_fetch_and_or ((mem), 1 << (__bit)) & (1 << (__bit))); }) - -# define atomic_and(mem, mask) (void) __sync_fetch_and_and ((mem), (mask)) -# define atomic_and_val(mem, mask) __sync_fetch_and_and ((mem), (mask)) - -# define atomic_or(mem, mask) (void) __sync_fetch_and_or ((mem), (mask)) -# define atomic_or_val(mem, mask) __sync_fetch_and_or ((mem), (mask)) - #else /* !__mips16 && !__GNUC_PREREQ (4, 8) */ /* This implementation using inline assembly will be removed once glibc requires GCC 4.8 or later to build. */ |