[LLVMbugs] [Bug 4778] New: msp430 specific: problem with constraint 'r' in inline asm
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Tue Aug 25 10:43:44 PDT 2009
http://llvm.org/bugs/show_bug.cgi?id=4778
Summary: msp430 specific: problem with constraint 'r' in inline
asm
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: regehr at cs.utah.edu
CC: asl at math.spbu.ru, llvmbugs at cs.uiuc.edu
For this code:
char __nesc_atomic_start(void )
{
char result = (({
unsigned int __x;
__asm volatile ("mov r2, %0" : "=r"((unsigned int)__x));__x;
}
)
& 0x0008) != 0;
__asm volatile ("dint");
__asm volatile ("nop");
__asm volatile ("" : : : "memory");
return result;
}
We want something like this:
regehr at john-home:~/z/tinyos-2.x/apps/Null/build/telosb$ msp430-gcc small.c -Os
-S -o -
__nesc_atomic_start:
mov r2, r15
clrc
rrc r15
rra r15
rra r15
and.b #llo(1), r15
dint
nop
sxt r15
ret
But we get:
regehr at john-home:~/z/tinyos-2.x/apps/Null/build/telosb$ clang -ccc-host-triple
msp430-generic-generic -ccc-clang-archs msp430 -x c -S -w -O2 small.c
-fheinous-gnu-extensions
fatal error: error in backend: Couldn't allocate output reg for constraint 'r'!
--
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