Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#867 generic pointer problem

closed-fixed
Erik Petrich
5
2013-05-25
2005-01-19
Josef Pavlik
No

hi,
I found, that an generic pointer to xdata structure at fixed address is
generated as pointer to data segment
try to compile the following piece of code

struct x { unsigned char a; };

xdata struct x at 0x8000 nv;
xdata struct x nv2;

void f(void *ptr) {}

int main()
{
f(&nv);
f(&nv2);
}

as you can see in the result, the first call is generated with pointer
type 0 (data pointer). The second call is ok (1 = xdata pointer)

;x.c:10: f(&nv);
; genCall
; Peephole 182.b used 16 bit load of dptr
mov dptr,#0x8000
mov b,#0x00
lcall _f
;x.c:11: f(&nv2);
; genCall
; Peephole 182.a used 16 bit load of DPTR
mov dptr,#_nv2
mov b,#0x01
; Peephole 253.b replaced lcall/ret with ljmp
ljmp _f

ciao
Jet

Discussion

  • Erik Petrich
    Erik Petrich
    2005-04-03

    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed
     
  • Erik Petrich
    Erik Petrich
    2005-04-03

    Logged In: YES
    user_id=635249

    Fixed in src/SDCCast.c 1.251 (SDCC version 2.4.8 #991)