From 818ce0e022c7ece340ef17c04ec1ee5e7ad6e626 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 3 Dec 2004 15:44:07 -0800 Subject: [PATCH] atomicity.h (__exchange_and_add, [...]): Split in-out memory constraints. * config/cpu/i486/atomicity.h (__exchange_and_add, __atomic_add): Split in-out memory constraints. From-SVN: r91706 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/config/cpu/i486/atomicity.h | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 22f0dce737ee..2b0baf770c26 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2004-12-03 Richard Henderson + + * 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. diff --git a/libstdc++-v3/config/cpu/i486/atomicity.h b/libstdc++-v3/config/cpu/i486/atomicity.h index 7c65fab678e6..1195cb93305b 100644 --- a/libstdc++-v3/config/cpu/i486/atomicity.h +++ b/libstdc++-v3/config/cpu/i486/atomicity.h @@ -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 */ -- 2.47.2