Back in the old days, GCC was the worst open-source beast, in terms of documentation of its internals. I have made two ports of GCC with sheer guess-work.
But, I think GCC is soon going to be the best documented open-source project. (Though, I suspect the code would still be quite messy).
Checkout this project from IIT-B. I like the approach in these docs; beginning with some conceptual treatment and then drilling down to implementation details (though the latter doesn’t seem to be complete yet)