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: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs