[PATCH] v850: Use __volatile__ qualifier on test_bit asm statements

From: Miles Bader
Date: Mon Jul 05 2004 - 04:39:18 EST


Otherwise recent versions of gcc seem to optimize away some necessary tests.

Signed-off-by: Miles Bader <miles@xxxxxxx>

include/asm-v850/bitops.h | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)

diff -ruN -X../cludes linux-2.6.7-uc0/include/asm-v850/bitops.h linux-2.6.7-uc0-v850-20040705/include/asm-v850/bitops.h
--- linux-2.6.7-uc0/include/asm-v850/bitops.h 2004-05-11 13:20:53.000000000 +0900
+++ linux-2.6.7-uc0-v850-20040705/include/asm-v850/bitops.h 2004-07-05 18:21:33.000000000 +0900
@@ -127,20 +127,20 @@
#define test_and_change_bit(nr, addr) __tns_atomic_bit_op ("not1", nr, addr)


-#define __const_test_bit(nr, addr) \
- ({ int __test_bit_res; \
- __asm__ ("tst1 (%1 - 0x123), %2; setf nz, %0" \
- : "=r" (__test_bit_res) \
- : "g" (((nr) & 0x7) + 0x123), \
- "m" (*((const char *)(addr) + ((nr) >> 3)))); \
- __test_bit_res; \
+#define __const_test_bit(nr, addr) \
+ ({ int __test_bit_res; \
+ __asm__ __volatile__ ("tst1 (%1 - 0x123), %2; setf nz, %0" \
+ : "=r" (__test_bit_res) \
+ : "g" (((nr) & 0x7) + 0x123), \
+ "m" (*((const char *)(addr) + ((nr) >> 3)))); \
+ __test_bit_res; \
})
extern __inline__ int __test_bit (int nr, const void *addr)
{
int res;
- __asm__ ("tst1 %1, [%2]; setf nz, %0"
- : "=r" (res)
- : "r" (nr & 0x7), "r" (addr + (nr >> 3)));
+ __asm__ __volatile__ ("tst1 %1, [%2]; setf nz, %0"
+ : "=r" (res)
+ : "r" (nr & 0x7), "r" (addr + (nr >> 3)));
return res;
}
#define test_bit(nr,addr) \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/