I don't know if I would call it crashing, but sdcc (Small Device C Compiler) fails at compiling code formed in a particular way:
- Target: 8051
- Code had to execute in a 512 byte cache loaded from an external tester
- Tester is in control and stores the code - cache can't fetch the next page
- No function calls allowed - the PC (program counter) would skip to a place not resident in cache; preprocessor macros were used to accomplish modular coding practice
- Jumps (branching) allowed if it doesn't skip out of the cache
- No const values - in the data section of the program code which causes code in cache to fetch something not in cache - preprocessor constant (#define) OK here
The preprocessor macros are unrolled resulting in flat, but large code - everything in main(); execution skips the startup code (setting up the stack, etc) and starts at the beginning of main()
Relevant part of this answer:
Occasionally, sdcc would refuse to compile syntactically correct code, with a message about running out of memory. This even happened compiling on 64-bit boxes with 8GB of RAM.
The solution in these cases was to split the firmware into separate pieces and compile them separately and execute them separately. The pieces may have been able to be linked back together, but at that point it didn't matter.
I didn't try it, but the Keil 8051 compiler probably could have handled the problematic code.