SDCC has the best OSS 8051 compiler. It is buggy as hell, but it is free. Sometimes that is good enough.
Whereas sdcc works brilliantly for z80 lineage processors. I wrote quite a lot of C for Gameboy recently and didn't find a single compiler bug in sdcc which revised my opinion of it upwards greatly.
Doesn't sounds like a bug in the compiler, sounds more like `volatile` was not used (unless, of course, `volatile` was not being honoured).
EDIT: but SDCC indeed ignored 'volatile': https://sourceforge.net/p/sdcc/bugs/436/
But I wrote non-trivial code with sdcc regardless. My favorite 8051 targets are FX2LP USB boards from aliexpress. :)
> two simulators used for testing, sim51 (a plain 8051) and minitel_sim
Narrator: No, he was not.