Inline asm - only clobber list case sensitive?

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

 



Hi,

yesterday I've been facing a strange problem with some inline asm
code (see below), emitting errors like these:
(gcc 4.7.3, targetting m68k-elf, Windows 7/64, msys):

rs232_2.c:2433:2: error: unknown register name '%CC' in 'asm'
rs232_2.c:2433:2: error: unknown register name '%D1' in 'asm'
rs232_2.c:2433:2: error: unknown register name '%D0' in 'asm'
rs232_2.c:2433:2: error: unknown register name '%A1' in 'asm'
rs232_2.c:2433:2: error: unknown register name '%A0' in 'asm'


Further investigation revealed that the problem is related to case
sensitivity of the register names. I played around with upper/lower case
to check this:

asm volatile (
    "    move.l   %[in1],%%a0 \n" // asm code
    "    move.l   %[in2],%%A1 \n"
    "    trap     #8          \n"
    "    move.b   %%D0,%[out1]\n"
    "    move.b   %%d1,%[out2]\n"
    :[out1] "=m" (*pc1),          // output
     [out2] "=m" (*pc2)
    :[in1]  "r"  (cmdadr),        // input
     [in2]  "r"  (DUMRadr)
    :"%a0","%A1","%d0","%D1",     // clobber list
     "memory","%CC"
    );

Results in:
rs232_2.c:2433:2: error: unknown register name '%CC' in 'asm'
rs232_2.c:2433:2: error: unknown register name '%D1' in 'asm'
rs232_2.c:2433:2: error: unknown register name '%A1' in 'asm'


The assembler does not complain about %a0 and %d0, which leads me to
the conclusion that:


* Register names being upper case are not recognized - but only in the
clobber list.

Is this intentional, a feature or a bug?


Best Regards
Michael Weise




[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