Skip to content

clang: unsupported inline asm: input with type 'int' matching output with type 'u8' (aka 'unsigned char') #9630

Closed
@edwintorok

Description

@edwintorok
Bugzilla Link 9258
Resolution DUPLICATE
Resolved on Feb 21, 2011 16:10
Version trunk
OS Linux
Blocks #4440
CC @nlewycky

Extended Description

Can't compile Xen:

arch/x86/xen/spinlock.c:284:14: error: unsupported inline asm: input with type 'int' matching output with type 'u8' (aka 'unsigned char')
: "1" (1)
^
Testcase:
typedef unsigned char u8;
struct arch_spinlock;
struct xen_spinlock {
unsigned char lock;
unsigned short spinners;
};
void foo(struct arch_spinlock *lock)
{
u8 oldval;
unsigned timeout;
struct xen_spinlock *xl = (struct xen_spinlock *)lock;
asm("1: xchgb %1,%0\n"
" testb %1,%1\n"
" jz 3f\n"
"2: rep;nop\n"
" cmpb $0,%0\n"
" je 1b\n"
" dec %2\n"
" jnz 2b\n"
"3:\n"
: "+m" (xl->lock), "=q" (oldval), "+r" (timeout)
: "1" (1)
: "memory");

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclangClang issues not falling into any other categoryduplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions