[LLVMbugs] [Bug 4776] New: msp430 backend: placing a variable at a specific address doesn't seem to work

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Aug 25 10:27:54 PDT 2009


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

           Summary: msp430 backend: placing a variable at a specific address
                    doesn't seem to 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: asl at math.spbu.ru, llvmbugs at cs.uiuc.edu


Consider this code:

volatile unsigned char P1OUT __asm ("0x0021");

unsigned char foo (unsigned char x)
{
  unsigned char tmp = P1OUT;
  P1OUT = x;
  return tmp;
}

Using mspgcc...

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

However using clang...

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 -o -
foo:
        push.w  r4
        mov.w   r1, r4
        mov.b   r15, r12
        mov.b   &_30_x0021, r15
        mov.b   r12, &_30_x0021
        pop.w   r4
        ret

Perhaps this is just a typo in the emitted code?  It looks almost correct.


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