Hello,

line 4816 of stm8/gen.c is

else if (size == 1 && aopOnStack (left->aop, 0, 1) && aopOnStack (right->aop, 0, 1) && regDead (A_IDX, ic) && shiftop->regs[A_IDX] == -1 && result->aop->regs[A_IDX] == -1 && left->aop->regs[A_IDX] == -1) // TODO: More cases.

I guess it should be

else if (size == 1 && aopOnStack (left->aop, 0, 1) && aopOnStack (result->aop, 0, 1) && regDead (A_IDX, ic) && shiftop->regs[A_IDX] == -1 && result->aop->regs[A_IDX] == -1 && left->aop->regs[A_IDX] == -1) // TODO: More cases.

Since operand right is already a literal, it could not be on stack.

Ben