Commit 09f2a1e4 by Jan Hubicka Committed by Jan Hubicka

* include/ext/atomicity.h

	(__exchange_and_add, __atomic_add): Mark throw ().
	* config/os/aix/atomicity.h
	* config/os/aix/atomicity.h
	* config/os/irix/atomicity.h
	* config/cpu/cris/atomicity.h
	* config/cpu/m68k/atomicity.h
	* config/cpu/hppa/atomicity.h
	* config/cpu/sparc/atomicity.h
	* config/cpu/i386/atomicity.h
	* config/cpu/i486/atomicity.h
	* config/cpu/sh/atomicity.h
	* config/cpu/generic/atomicity_mutex/atomicity.h
	* config/cpu/generic/atomicity_builtins/atomicity.h
	(__exchange_and_add, __atomic_add): Mark throw ().

From-SVN: r146576
parent f1eea135
2009-04-21 Jan Hubicka <jh@suse.cz>
* include/ext/atomicity.h
(__exchange_and_add, __atomic_add): Mark throw ().
* config/os/aix/atomicity.h
* config/os/aix/atomicity.h
* config/os/irix/atomicity.h
* config/cpu/cris/atomicity.h
* config/cpu/m68k/atomicity.h
* config/cpu/hppa/atomicity.h
* config/cpu/sparc/atomicity.h
* config/cpu/i386/atomicity.h
* config/cpu/i486/atomicity.h
* config/cpu/sh/atomicity.h
* config/cpu/generic/atomicity_mutex/atomicity.h
* config/cpu/generic/atomicity_builtins/atomicity.h
(__exchange_and_add, __atomic_add): Mark throw ().
2009-04-21 Paolo Carlini <paolo.carlini@oracle.com> 2009-04-21 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/39835 PR libstdc++/39835
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
int __tmp; int __tmp;
_Atomic_word __result; _Atomic_word __result;
...@@ -80,7 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -80,7 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
} }
void void
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ __exchange_and_add(__mem, __val); } { __exchange_and_add(__mem, __val); }
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
...@@ -34,12 +34,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -34,12 +34,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ return __sync_fetch_and_add(__mem, __val); } { return __sync_fetch_and_add(__mem, __val); }
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ __sync_fetch_and_add(__mem, __val); } { __sync_fetch_and_add(__mem, __val); }
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
...@@ -44,7 +44,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -44,7 +44,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
__gnu_cxx::__scoped_lock sentry(get_atomic_mutex()); __gnu_cxx::__scoped_lock sentry(get_atomic_mutex());
_Atomic_word __result; _Atomic_word __result;
...@@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ __exchange_and_add(__mem, __val); } { __exchange_and_add(__mem, __val); }
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
...@@ -43,7 +43,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -43,7 +43,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
int int
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word result; _Atomic_word result;
int tmp; int tmp;
...@@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
int tmp; int tmp;
volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock; volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock;
......
...@@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
register _Atomic_word __result, __tmp = 1; register _Atomic_word __result, __tmp = 1;
...@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ __exchange_and_add(__mem, __val); } { __exchange_and_add(__mem, __val); }
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
...@@ -28,7 +28,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -28,7 +28,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
register _Atomic_word __result; register _Atomic_word __result;
__asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}" __asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}"
...@@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
__asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}" __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
: "=m" (*__mem) : "ir" (__val), "m" (*__mem)); : "=m" (*__mem) : "ir" (__val), "m" (*__mem));
......
...@@ -32,7 +32,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -32,7 +32,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// These variants support compare-and-swap. // These variants support compare-and-swap.
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
register _Atomic_word __result = *__mem; register _Atomic_word __result = *__mem;
register _Atomic_word __temp; register _Atomic_word __temp;
...@@ -50,7 +50,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -50,7 +50,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// Disable interrupts, which we can do only from supervisor mode. // Disable interrupts, which we can do only from supervisor mode.
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word __result; _Atomic_word __result;
short __level, __tmpsr; short __level, __tmpsr;
...@@ -79,7 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -79,7 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word __result; _Atomic_word __result;
...@@ -119,7 +119,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -119,7 +119,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
// Careful: using add.l with a memory destination is not // Careful: using add.l with a memory destination is not
// architecturally guaranteed to be atomic. // architecturally guaranteed to be atomic.
......
...@@ -33,7 +33,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -33,7 +33,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val) __exchange_and_add (volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word __result; _Atomic_word __result;
...@@ -54,7 +54,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -54,7 +54,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val) __atomic_add (volatile _Atomic_word* __mem, int __val) throw ()
{ {
asm("0:\n" asm("0:\n"
"\tmovli.l\t@%1,r0\n" "\tmovli.l\t@%1,r0\n"
...@@ -84,7 +84,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -84,7 +84,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
__gnu_cxx::__scoped_lock sentry(atomic_mutex); __gnu_cxx::__scoped_lock sentry(atomic_mutex);
_Atomic_word __result; _Atomic_word __result;
...@@ -95,7 +95,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -95,7 +95,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ __exchange_and_add(__mem, __val); } { __exchange_and_add(__mem, __val); }
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
......
...@@ -30,7 +30,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -30,7 +30,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
#ifdef __arch64__ #ifdef __arch64__
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word __tmp1, __tmp2; _Atomic_word __tmp1, __tmp2;
_Atomic_word __val_extended = __val; _Atomic_word __val_extended = __val;
...@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word __tmp1, __tmp2; _Atomic_word __tmp1, __tmp2;
_Atomic_word __val_extended = __val; _Atomic_word __val_extended = __val;
...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word __result, __tmp; _Atomic_word __result, __tmp;
...@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ {
_Atomic_word __tmp; _Atomic_word __tmp;
......
...@@ -42,12 +42,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -42,12 +42,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val) __exchange_and_add (volatile _Atomic_word* __mem, int __val) throw ()
{ return ::fetch_and_add(const_cast<atomic_p>(__mem), __val); } { return ::fetch_and_add(const_cast<atomic_p>(__mem), __val); }
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val) __atomic_add (volatile _Atomic_word* __mem, int __val) throw ()
{ (void) ::fetch_and_add(const_cast<atomic_p>(__mem), __val); } { (void) ::fetch_and_add(const_cast<atomic_p>(__mem), __val); }
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
...@@ -28,11 +28,11 @@ ...@@ -28,11 +28,11 @@
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Atomic_word _Atomic_word
__exchange_and_add(volatile _Atomic_word* __mem, int __val) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
{ return (_Atomic_word) test_then_add((unsigned long*) const_cast<_Atomic_word*>(__mem), __val); } { return (_Atomic_word) test_then_add((unsigned long*) const_cast<_Atomic_word*>(__mem), __val); }
void void
__atomic_add(volatile _Atomic_word* __mem, int __val) __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
{ __exchange_and_add(__mem, __val); } { __exchange_and_add(__mem, __val); }
_GLIBCXX_END_NAMESPACE _GLIBCXX_END_NAMESPACE
...@@ -51,11 +51,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -51,11 +51,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
#else #else
_Atomic_word _Atomic_word
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word*, int); __exchange_and_add(volatile _Atomic_word*, int) throw ();
void void
__attribute__ ((__unused__)) __attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word*, int); __atomic_add(volatile _Atomic_word*, int) throw ();
#endif #endif
static inline _Atomic_word static inline _Atomic_word
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment