]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
atomicity.h (__exchange_and_add, [...]): Split in-out memory constraints.
authorRichard Henderson <rth@redhat.com>
Fri, 3 Dec 2004 23:44:07 +0000 (15:44 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 3 Dec 2004 23:44:07 +0000 (15:44 -0800)
* config/cpu/i486/atomicity.h (__exchange_and_add, __atomic_add):
Split in-out memory constraints.

From-SVN: r91706

libstdc++-v3/ChangeLog
libstdc++-v3/config/cpu/i486/atomicity.h

index 22f0dce737eed7326fd859d5a0557530fa1ce27d..2b0baf770c261b5617c4866534af3e8fb2728eb6 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-03  Richard Henderson  <rth@redhat.com>
+
+       * config/cpu/i486/atomicity.h (__exchange_and_add, __atomic_add):
+       Split in-out memory constraints.
+
 2004-09-30  Release Manager
 
        * GCC 3.3.5 Released.
index 7c65fab678e60e5a75e3f973f0a34562ac6a8890..1195cb93305bc4f96c97b59892cc1f58924a9c50 100644 (file)
@@ -1,6 +1,6 @@
 // Low-level functions for atomic operations: x86, x >= 4 version  -*- C++ -*-
 
-// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -38,8 +38,8 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
 {
   register _Atomic_word __result;
   __asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}"
-                       : "=r" (__result), "+m" (*__mem) 
-                        : "0" (__val)
+                       : "=r" (__result), "=m" (*__mem) 
+                        : "0" (__val), "m"(*__mem)
                         : "memory");
   return __result;
 }
@@ -49,7 +49,9 @@ __attribute__ ((__unused__))
 __atomic_add (volatile _Atomic_word* __mem, int __val)
 {
   __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
-                       : "+m" (*__mem) : "ir" (__val) : "memory");
+                       : "=m" (*__mem)
+                       : "ir" (__val), "m"(*__mem)
+                       : "memory");
 }
 
 #endif /* atomicity.h */