As of revision #8703, fails for me for stm8, but I have no idea when it started failing: AFAIR, everything worked last time I comitted to sdcc, and the one change by Valentin in between seems correct (I closely looked at it).
Philipp
P.S.: It probably would be good to introduce automatic regression testing for stm8 soon.
Still fails as of revision #8916.
Philipp
The compiler generates correct code; the simulator was broken. Fixed in revision #9031 by applying patch #244 by Ben Shi.
Philipp