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

           Summary: msp430 backend: static function-scope variable at
                    specific address doesn't work
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


reg...@john-home:~/z/tinyos-2.x/apps/Null/build/telosb$ cat p1.c

unsigned char foo (unsigned char x)
{
  static volatile unsigned char P1OUT __asm ("0x0021");
  unsigned char tmp = P1OUT;
  P1OUT = x;
  return tmp;
}

reg...@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 p1.c

p1.c:3:26: error: cannot compile this __asm__ yet
  volatile unsigned char P1OUT __asm ("0x0021");
                         ^
1 diagnostic generated.



The emitted code should be identical to placing the register in file scope:

reg...@john-home:~/z/tinyos-2.x/apps/Null/build/telosb$ msp430-gcc -O p1.c -S
-o -
foo:
        mov.b   &0x0021, r14
        mov.b   r15, &0x0021
        mov.b   r14, r15
        ret


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

Reply via email to