Attached example generates wrong code using command line:
sdcc -mz80 -c --max-allocs-per-node 60000 sdccerr.c
- lines 95, 95 - hl is populated by function parameter 'i'
- line 104 - ldir is done with bc=4, causing hl to be incremented by 4
- lines 120-126 - structure pointed by 'i' is being populated using hl, but hl points 4 bytes forward already - changed by ldir!
problem does not occur when omitting --max-allocs-per-node.
SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.1 #8054 (Jul 25 2012) (Linux)
Log in to post a comment.