It is a complex error, I simpified the source as I can. Present in current build of SDCC.
#define __ASHL(x, n, t) ((t)(x)<<(n))
extern void Laser2_PTBL (signed char col, signed char row, unsigned char spn);
static int yy;
static void Sub_9300 (void)
{
unsigned char i, j, n, _for__84, _for__83; int a;
j = 0;
_for__84 = 3;
do {
i = 0;
_for__83 = 9;
do {
n = i;
if (j == 1) {
n = 8 - i;
}
a = (int)(j * 9 + i) * 250;
if (yy > a) {
Laser2_PTBL(26 - n * 3, 19 - __ASHL(j, 2, unsigned char), 115);
}
i += 1;
} while (--_for__83);
j += 1;
} while (--_for__84);
}
sdcc Durak.c -mz80 --code-loc 32832 --data-loc 63488 --oldralloc --reserve-regs-iy
(z80.lib must be available)
Another similar error was presents in SDCC 3.6.0 #9615
but fixed in SDCC 3.9.3 #11378 (MINGW32)
Perhaps this info will be helpful.
I'm sorry that there is so much code, but if I remove even a line, the error disappears.
sdcc Durak.c -mz80 --code-loc 32832 --data-loc 63488 --oldralloc --reserve-regs-iy
Looks like a bug in the old register allocator, which has been removed for z80.