This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
asm conflict question
- From: Richard Bonomo <bonomo at sal dot wisc dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 9 Aug 2006 10:12:40 -0500 (CDT)
- Subject: asm conflict question
I am hoping someone can give me a little
advice in how to proceed. I have
some C-code which I compile under
gcc-3.4.5 which employs a definition
such as this:
#define disable() \
({ register int __Status __asm__ ("d"); \
__asm__ ("clra ; save CPU status"); \
__asm__ volatile ("tfr cc,b" : "=d" (__Status) : : "d", "b"); \
__asm__ ("orcc #0x50 ; disable interrupts"); \
__Status; })
When an attempt is made to compile, upon hitting the
spot in the program where this code winds up being
inserted, the compiler produces this error message
error: asm-specifier for variable `__Status' conflicts with asm clobber list
and quits.
After doing quite a bit if digging, I do know that for some
reason the compiler is probably complaining about the
assignment of register "d" (which includes registers
"a" and "b" in the Motorola 6809 as its high and
low components).
However, I am still at quite a loss as to how
I am to deal with this: how do I get around this,
short of rewriting this and other functions to
use ordinary variables as much as possible?
Can you shed any light on what, precisely is being
objected to, and how to meet that objection?
Thanks!
Rich B.
--
************************************************
Richard Bonomo
UW Space Astronomy Laboratory
ph: (608) 263-4683 telefacsimile: (608) 263-0361
SAL-related email: bonomo@sal.wisc.edu
all other email: bonomo@ece.wisc.edu
web page URL: http://www.cae.wisc.edu/~bonomo
************************************************