asm conflict question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxxx
all other email: bonomo@xxxxxxxxxxxx
web page URL: http://www.cae.wisc.edu/~bonomo
************************************************

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux