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]

asm() usage: how to get rid of a gas warning (i386)?


Hello!

I have a portion of code with inline asm() inctructions compiled by gcc. Sometimes it causes gas to
issue a warning:
"Warning: missing operand; zero assumed"

This is due to the following line of code (unnecessary part or asm code is omitted).

asm (...
    "adcl %3,4+%1; \n"
    : "=c" (Cur), "=o" (Sum), "=&a" (_eax), "=&d" (_edx)
    : "0" (Cur), "1" (Sum)
    : "cc");

That instruction is sometimes converted into correct instruction, something like
adcl %edx,4+48(%esi)
- and sometimes I get
adcl %edx,4+(%ebx)
- which causes the above warning.

Is the constraint "=o" right? I'm just accessing i64-type variable Sum by it's address.

Best Regards, Alexander Melkov



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]