This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix ARM atomicity.h


Hi,

this patch has been pre-approved by Benjamin Kosnik, it does the same for ARM 
as my last patch did for PPC atomicity.h. Hopefully it will fix the same 
large amount of testcases as it did on PPC.

Franz.

        * config/cpu/arm/bits/atomicity.h (__exchange_and_add): Add
        __volatile__ to asm.
        (__atomic_add): Likewise.
        (__compare_and_swap): Likewise.
        (__always_swap): Likewise.
        (__test_and_set): Likewise.

Index: libstdc++-v3/config/cpu/arm/bits/atomicity.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/cpu/arm/bits/atomicity.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- libstdc++-v3/config/cpu/arm/bits/atomicity.h	2000/08/22 18:24:15	1.2
+++ libstdc++-v3/config/cpu/arm/bits/atomicity.h	2000/11/27 20:07:15	1.3
@@ -27,7 +27,7 @@ __attribute__ ((__unused__))
 __exchange_and_add (volatile _Atomic_word* __mem, int __val)
 {
   _Atomic_word __tmp, __tmp2, __result;
-  __asm__ ("\
+  __asm__ __volatile__ ("\
 0:      ldr     %0,[%3]
         add     %1,%0,%4
         swp     %2,%1,[%3]
@@ -45,7 +45,7 @@ __attribute__ ((__unused__))
 __atomic_add (volatile _Atomic_word *__mem, int __val)
 {
   _Atomic_word __tmp, __tmp2, __tmp3;
-  __asm__ ("\
+  __asm__ __volatile__ ("\
 0:      ldr     %0,[%3]
         add     %1,%0,%4
         swp     %2,%1,[%3]
@@ -63,7 +63,7 @@ __compare_and_swap (volatile long *__p, 
 {
   int __result;
   long __tmp;
-  __asm__ ("\
+  __asm__ __volatile__ ("\
 0:      ldr     %1,[%2]
         mov     %0,#0
         cmp     %1,%4
@@ -85,7 +85,7 @@ __attribute__ ((__unused__))
 __always_swap (volatile long *__p, long __newval)
 {
   long __result;
-  __asm__ ("\
+  __asm__ __volatile__ ("\
         swp     %0,%2,[%1]
 " : "=&r"(__result) : "r"(__p), "r"(__newval) : "memory");
   return __result;
@@ -97,7 +97,7 @@ __test_and_set (volatile long *__p, long
 {
   int __result;
   long __tmp;
-  __asm__ ("\
+  __asm__ __volatile__ ("\
 0:      ldr     %0,[%2]
         cmp     %0,#0
         bne     1f

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]