m68k: fix 64-bit arithmetic in atomic operations (bug 18128)
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 13 Mar 2015 17:21:55 +0000 (18:21 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Sat, 14 Mar 2015 21:27:36 +0000 (22:27 +0100)
ChangeLog
NEWS
sysdeps/m68k/m680x0/m68020/bits/atomic.h

index 3b1255227526ebe33506738345095a315ac564e5..9b3426b2206415f58e4c8b15254f3d2325910579 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-14  Andreas Schwab  <schwab@linux-m68k.org>
+
+       [BZ #18128]
+       * sysdeps/m68k/m680x0/m68020/bits/atomic.h (atomic_exchange_and_add)
+       (atomic_add, atomic_increment_and_test)
+       (atomic_decrement_and_test): Fix 64-bit arithmetic.
+
 2015-03-13  Paul Eggert  <eggert@cs.ucla.edu>
 
        * stdlib/setenv.c (__add_to_environ):
diff --git a/NEWS b/NEWS
index 4e0024bd1ad44fad1e7e518723ba68ee0b4a9432..4ef81d3a1692aa75495c95baf1b4c8b6d2b7af52 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,7 @@ Version 2.22
   17779, 17792, 17836, 17912, 17916, 17932, 17944, 17949, 17964, 17965,
   17967, 17969, 17978, 17987, 17991, 17996, 17998, 17999, 18019, 18020,
   18029, 18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047,
-  18068, 18080, 18093, 18104, 18110, 18111.
+  18068, 18080, 18093, 18104, 18110, 18111, 18128.
 
 * Character encoding and ctype tables were updated to Unicode 7.0.0, using
   new generator scripts contributed by Pravin Satpute and Mike FABIAN (Red
index 2038037ee43b3e0dc3ca8679b590572ebf444c92..9a29022af9be91952b6c0227a88cfe16a0d9a851 100644 (file)
@@ -139,8 +139,8 @@ typedef uintmax_t uatomic_max_t;
         __typeof (mem) __memp = (mem);                                       \
         __asm __volatile ("1: move%.l %0,%1;"                                \
                           "   move%.l %R0,%R1;"                              \
-                          "   add%.l %2,%1;"                                 \
-                          "   addx%.l %R2,%R1;"                              \
+                          "   add%.l %R2,%R1;"                               \
+                          "   addx%.l %2,%1;"                                \
                           "   cas2%.l %0:%R0,%1:%R1,(%3):(%4);"              \
                           "   jbne 1b"                                       \
                           : "=d" (__result), "=&d" (__temp)                  \
@@ -170,8 +170,8 @@ typedef uintmax_t uatomic_max_t;
                __typeof (*(mem)) __temp;                                     \
                __asm __volatile ("1: move%.l %0,%1;"                         \
                                  "   move%.l %R0,%R1;"                       \
-                                 "   add%.l %2,%1;"                          \
-                                 "   addx%.l %R2,%R1;"                       \
+                                 "   add%.l %R2,%R1;"                        \
+                                 "   addx%.l %2,%1;"                         \
                                  "   cas2%.l %0:%R0,%1:%R1,(%3):(%4);"       \
                                  "   jbne 1b"                                \
                                  : "=d" (__oldval), "=&d" (__temp)           \
@@ -199,8 +199,8 @@ typedef uintmax_t uatomic_max_t;
         __typeof (*(mem)) __temp;                                            \
         __asm __volatile ("1: move%.l %1,%2;"                                \
                           "   move%.l %R1,%R2;"                              \
-                          "   addq%.l %#1,%2;"                               \
-                          "   addx%.l %5,%R2;"                               \
+                          "   addq%.l %#1,%R2;"                              \
+                          "   addx%.l %5,%2;"                                \
                           "   seq %0;"                                       \
                           "   cas2%.l %1:%R1,%2:%R2,(%3):(%4);"              \
                           "   jbne 1b"                                       \
@@ -230,8 +230,8 @@ typedef uintmax_t uatomic_max_t;
         __typeof (*(mem)) __temp;                                            \
         __asm __volatile ("1: move%.l %1,%2;"                                \
                           "   move%.l %R1,%R2;"                              \
-                          "   subq%.l %#1,%2;"                               \
-                          "   subx%.l %5,%R2;"                               \
+                          "   subq%.l %#1,%R2;"                              \
+                          "   subx%.l %5,%2;"                                \
                           "   seq %0;"                                       \
                           "   cas2%.l %1:%R1,%2:%R2,(%3):(%4);"              \
                           "   jbne 1b"                                       \