For 8051 cores there's the SDCC project but I don't know how stable/mature is and/or what are its limitations. And it's a C compiler only as far as I know.