aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2009-12-03 14:26:46 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2009-12-03 14:26:46 +0000
commitcf9eb56580e4ebabff35cfa5484ece3c86f1120c (patch)
treecee4c3991885f7b08b311be973bc810a20c2b461
parentbcaf576b83e0c2332c2f78acb5ec7d060fdbab46 (diff)
downloadgcc-cf9eb56580e4ebabff35cfa5484ece3c86f1120c.zip
gcc-cf9eb56580e4ebabff35cfa5484ece3c86f1120c.tar.gz
gcc-cf9eb56580e4ebabff35cfa5484ece3c86f1120c.tar.bz2
linux-atomic.c (SYNC_LOCK_RELEASE): Place memory barrier before the lock release.
* arm/linux-atomic.c (SYNC_LOCK_RELEASE): Place memory barrier before the lock release. From-SVN: r154949
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/linux-atomic.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0c99c6e..258890d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-03 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm/linux-atomic.c (SYNC_LOCK_RELEASE): Place memory barrier
+ before the lock release.
+
2009-12-03 Michael Matz <matz@suse.de>
PR middle-end/38474
diff --git a/gcc/config/arm/linux-atomic.c b/gcc/config/arm/linux-atomic.c
index 14d4a53..20ad296 100644
--- a/gcc/config/arm/linux-atomic.c
+++ b/gcc/config/arm/linux-atomic.c
@@ -266,8 +266,10 @@ SUBWORD_TEST_AND_SET (char, 1)
void HIDDEN \
__sync_lock_release_##WIDTH (TYPE *ptr) \
{ \
- *ptr = 0; \
+ /* All writes before this point must be seen before we release \
+ the lock itself. */ \
__kernel_dmb (); \
+ *ptr = 0; \
}
SYNC_LOCK_RELEASE (int, 4)