The peephole rules 600a and 600b for the stm8 port are missing conditions: they should not apply if %1 is a register, since in that case the ld a, %1 does no affect flags. This is a bug in trunk, which has the potential for silently resulting in bad code, but so far I only managed to trigger it in the nosidechannels branch. It is not a regression vs. 4.5.0.
IMO the bug is not important enough to delay 4.6.0, but if an SDCC 4.6.0 RC3 is needed for other reasons, we should include the attached fix.