Content-Type: multipart/alternative; boundary="------------020608030207020300070901" --------------020608030207020300070901 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > > >>I experienced the problem, that SDCC (DS390/DS400 port) assigned the >>same registers to overlapping iTemps. >>This error originates in the function to spill a symbol. If the symbol >>was spilled on the stack, the function tried to free registers >>r0 and r1. But if we use stack in xram than these registers mustn't be >>freed. >> >>I attached a patch to fix this problem. >> >> >Could you please add a piece of source, where this fix is needed? > compiled with: sdcc -mds400 -c fat.c ; fat.c:83: file_info->buffer_start += size2; ; genPointerGet ; genFarPointerGet mov dpl,r5 mov dph,r6 mov dpx,r7 movx a,@dptr inc dptr mov r4,a movx a,@dptr mov r5,a ; <-----BUG: r5 is already used ; genPlus mov a,r2 add a,r4 mov r4,a mov a,r3 addc a,r5 mov r5,a ; genPointerSet mov dpl,r5 mov dph,r6 mov dpx,r7 mov a,r4 movx @dptr,a inc dptr mov a,r5 movx @dptr,a --------------020608030207020300070901 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit
I experienced the problem, that SDCC (DS390/DS400 port) assigned the
same registers to overlapping iTemps.
This error originates in the function to spill a symbol. If the symbol
was spilled on the stack, the function tried to free registers
r0 and r1. But if we use stack in xram than these registers mustn't be
freed.

I attached a patch to fix this problem.
    
Could you please add a piece of source, where this fix is needed?
compiled with:
sdcc -mds400 -c fat.c

;    fat.c:83: file_info->buffer_start += size2;
;    genPointerGet
;    genFarPointerGet
    mov    dpl,r5
    mov    dph,r6
    mov    dpx,r7
    movx    a,@dptr
    inc    dptr
    mov    r4,a
    movx    a,@dptr
    mov    r5,a  ; <-----BUG: r5 is already used
;    genPlus
    mov    a,r2
    add    a,r4
    mov    r4,a
    mov    a,r3
    addc    a,r5
    mov    r5,a
;    genPointerSet
    mov    dpl,r5
    mov    dph,r6
    mov    dpx,r7
    mov    a,r4
    movx    @dptr,a
    inc    dptr
    mov    a,r5
    movx    @dptr,a





--------------020608030207020300070901--