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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


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

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

However using clang...

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

Reply via email to