[LLVMbugs] [Bug 4777] New: msp430 backend: static function-scope variable at specific address doesn't work

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Aug 25 10:32:39 PDT 2009


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: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


regehr at 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;
}

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

regehr at 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.



More information about the llvm-bugs mailing list