Earlier quoted context omitted.
I haven't looked at this closely, but 6502 really doesn't lend itself to C compilation. Three registers, only one of which works with the ALU, awkward immovable stack, etc. The 65816 is a better target (moveable direct page and stack and some wider registers), but also awkward with its register mode switching.
Not only C, any language that thinks there’s other things than global state. If all your functions are void foo(void) and you don’t use local variables (or your language doesn’t support recursion, in which case all locals can be given a fixed address), targeting 6502 is fine (it also helps if you avoid floating point, use 8-bit variables where possible, etc) Not supporting recursion also means you can statically comp…
You'd need a little region for making use of (zp),Y, probably callee-saved, putting previous values on the return stack with PHA.