Hello Merlin
I agree with you, it is a good and fast solution.
Unfortunately, when I develop I don't use the optimizer (only for the release version) and in this case I survey any bug/malfunction of my code through the developing steps (as any developer ?
What will be fine, is to integrate this optimization in the compiler, it will be efficient for more than 90% of the procedure calls. Then moreover, if the frame size is too large and oblige to use SBC, add a locked sequence to manipulate the frame ptr after (and only after) the call, a little bit like in the new version of the scheduler.
The result will be useful, because we will be able to use local variables and any procedures in the interrupt handler without risk (except the time execution !).
Gerard