This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Inline asm - only clobber list case sensitive?


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]