C compilers have been written for stack processors, and run well
"run well" ...
for example, the machine code produced by gcc C/89 for hc11 in "expanded mode" (the CPU can fully address 64Kbyte) is an order of magnitude suboptimal than manual assembly programming. Hc11 has two index registers and only one accumulator, and it continuously needs push/pop in order to compute expresssion, doing IO stuff, and functions calls, so to follow the C machine layer model, from how to evaluate an expression (reverse polish notation is the best match here, all stack based) to how to handle calls of function (arguments pushed onto stack, response popped off stack), it always ends with much opcodes and stack space is wasted on machine-level glue code, which, being all stack-based, heavily uses asynchronous ram, which is several orders of magnitude slower than CPU registers.
Thank goodness, the hc11/E chip comes with half 1kbyte of internal (on-chip) static ram, and I can make better use of it by turning it into "virtual registers" to have more CPU registers, say 32 registers, like RISC. Yes, again "memory-based" operations instead of "pure register operations", and the code size only benedict a 2% off, which is nothing, but the speed up is 40%!!!
The commercial Avoget C/11 has a flag to use soft-registers, other commercial C compilers for hc11 don't have this trick, and with gcc ... you have to hack the old v3.3.6.
The point is that it's still suboptimal vs assembly programming, where you cleverly use resources and avoid repeated patterns ... here C has problems because "optimizing" the machine code produced by the HL is a very difficult task on stack-machines, and, in any case, it's the best trick you can do when you have 512byte of internal ram at your disposal.
So you say "run well" , I say "mumble"
