[LLVMbugs] [Bug 4236] New: Inline asm in linux-2.4. 37 rejected by clang-cc SVN version 72105

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue May 19 11:33:12 PDT 2009


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

           Summary: Inline asm in linux-2.4.37 rejected by clang-cc SVN
                    version 72105
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bagnara at cs.unipr.it
                CC: llvmbugs at cs.uiuc.edu


Both clang-cc SVN version 68830 and gcc 4.3.2 accept the following chunk 
of code (which was extracted from linux-2.4.37):

=========================================================
typedef struct {
        volatile unsigned int lock;
} spinlock_t;

static inline int spin_trylock(spinlock_t *lock)
{
        char oldval;
        __asm__ __volatile__(
                "xchgb %b0,%1"
                :"=q" (oldval), "=m" (lock->lock)
                :"0" (0) : "memory");
        return oldval > 0;
}
=========================================================


In contrast, clang-cc SVN version 72105 rejects it as follows:

bug.c:11:9: error: unsupported inline asm: input with type 'int' 
matching output
       with type 'char'
                 :"0" (0) : "memory");
                       ^
1 diagnostic generated.


-- 
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