[LLVMbugs] [Bug 9258] New: clang: unsupported inline asm: input with type 'int' matching output with type 'u8' (aka 'unsigned char')

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Feb 19 03:23:42 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9258

           Summary: clang: unsupported inline asm: input with type 'int'
                    matching output with type 'u8' (aka 'unsigned char')
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 4068


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");

}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list