diff options
| author | davem <davem@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-08 10:01:01 +0000 |
|---|---|---|
| committer | davem <davem@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-08 10:01:01 +0000 |
| commit | d93b4a22aafbc257cab7d2dd1340fef0f434953e (patch) | |
| tree | e6cee835a0f41fcd72603e166d05d15bb503e7b2 | |
| parent | b1e2825642cea9a9ca8acdf635b9b5d36d83da71 (diff) | |
| download | ppe42-gcc-d93b4a22aafbc257cab7d2dd1340fef0f434953e.tar.gz ppe42-gcc-d93b4a22aafbc257cab7d2dd1340fef0f434953e.zip | |
2003-12-08 David S. Miller <davem@redhat.com>
PR libstdc++/12496
* config/cpu/sparc/atomicity.h (__exchange_and_add, __atomic_add):
Extend increment to _Atomic_word before giving to assembler.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74409 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
| -rw-r--r-- | libstdc++-v3/config/cpu/sparc/atomicity.h | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9bd1553676f..8d2c9ac2b79 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2003-12-08 David S. Miller <davem@redhat.com> + + PR libstdc++/12496 + * config/cpu/sparc/atomicity.h (__exchange_and_add, __atomic_add): + Extend increment to _Atomic_word before giving to assembler. + 2003-12-06 Benjamin Kosnik <bkoz@redhat.com> * testsuite/ext/enc_filebuf/char/13189.cc: Guard for __enc_traits. diff --git a/libstdc++-v3/config/cpu/sparc/atomicity.h b/libstdc++-v3/config/cpu/sparc/atomicity.h index 4c9dbf6345d..93e3dff5195 100644 --- a/libstdc++-v3/config/cpu/sparc/atomicity.h +++ b/libstdc++-v3/config/cpu/sparc/atomicity.h @@ -39,6 +39,7 @@ __attribute__ ((__unused__)) __exchange_and_add (volatile _Atomic_word *__mem, int __val) { _Atomic_word __tmp1, __tmp2; + _Atomic_word __val_extended = __val; __asm__ __volatile__("1: ldx [%2], %0\n\t" " add %0, %3, %1\n\t" @@ -47,7 +48,7 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val) " brnz,pn %0, 1b\n\t" " nop" : "=&r" (__tmp1), "=&r" (__tmp2) - : "r" (__mem), "r" (__val) + : "r" (__mem), "r" (__val_extended) : "memory"); return __tmp2; } @@ -57,6 +58,7 @@ __attribute__ ((__unused__)) __atomic_add (volatile _Atomic_word* __mem, int __val) { _Atomic_word __tmp1, __tmp2; + _Atomic_word __val_extended = __val; __asm__ __volatile__("1: ldx [%2], %0\n\t" " add %0, %3, %1\n\t" @@ -65,7 +67,7 @@ __atomic_add (volatile _Atomic_word* __mem, int __val) " brnz,pn %0, 1b\n\t" " nop" : "=&r" (__tmp1), "=&r" (__tmp2) - : "r" (__mem), "r" (__val) + : "r" (__mem), "r" (__val_extended) : "memory"); } |

