All of lore.kernel.org
 help / color / mirror / Atom feed
From: miles@lsi.nec.co.jp (Miles Bader)
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] v850: Use __volatile__ qualifier on test_bit asm statements
Date: Mon,  5 Jul 2004 18:32:10 +0900 (JST)	[thread overview]
Message-ID: <20040705093210.985B4491@mctpc71> (raw)

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

Signed-off-by: Miles Bader <miles@gnu.org>

 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)						\

                 reply	other threads:[~2004-07-05  9:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040705093210.985B4491@mctpc71 \
    --to=miles@lsi.nec.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles@gnu.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.