Hi All.

It seams that `__builtin_return_address' does not work in mps430-gcc.
It takes contents of a top of a stack, without consideration his use.

Example:

   extern void foo (char *);
   extern void *p;
   void foo1 (void)
   {
       char s[10];
       foo(s);
       p= __builtin_return_address(0);
   }

Result /msp430-gcc (GCC) 3.4.0 20040107 (experimental)/:

   foo1:
   ;; prologue: frame size = 10
   .L__FrameSize_foo1=0xa
   .L__FrameOffset_foo1=0xa
        sub     #10, r1
   ;; prologue end (size=2)
        mov     r1, r15
        call    #foo
        mov     2(r1), &p       ??? must: 12(r1)
   ;; epilogue: frame size=10

Best wishes.


Reply via email to