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

Close

#1189 Error in work with pdata var

closed-fixed
Maarten Brock
5
2013-05-25
2006-08-26
Anonymous
No

25-AUG-2006

I'm found bug in SDCC MCS51 codegeneration:

SDCC -v:
SDCC:
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/d
s400/hc08 2.6.1 #4335 (Aug 13 2006) (MINGW32)

SDCC options:
sdcc --stack-auto --verbose --model-small --peep-asm -
mmcs51 --iram-size 256 --xram-size 1024 --code-size
57344 --nojtbound --use-stdout Test.c

Test.c

#include <stdbool.h>

static unsigned char __pdata tst1;
static unsigned char __pdata tst2;

static bool test;

void Bug(void)
{
test = (tst1 | tst2);
}

void main(void)
{ }

SDCC will generate this code for function "Bug":

mov r0,#_tst1
mov r1,#_tst2
setb c
movx a,@r0
movx a,@r1
orl a,a
jnz xxx$
clr c
xxx$:
mov _test,c

Error appears if tst1 and tst2 both allocate in pdata

Discussion

  • Maarten Brock
    Maarten Brock
    2006-08-26

    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     
  • Maarten Brock
    Maarten Brock
    2006-08-26

    Logged In: YES
    user_id=888171

    Fixed in SDCC 2.6.1 #4343