He Xiao <xiheasas@xxxxxxxxx> writes: > I am quite confused about how the gcc distinguish them. I know there > is a macro CALL_USED_REGISTER, where one register should be saved in > the stack when used in a function if the corresponding value in > CALL_USED_REGISTER is set to 0. So it becomes reasonable for the > caller to save the registers if their CALL_USED_REGISTER values are 1. To be clear, it's the other way around. If CALL_USED_REGISTER is 1, then the function is permitted to change the register. The prologue should save any registers which are used for which CALL_USED_REGISTER is 0. > But I didn't see GCC generate sw r24, sp, off. Is there something I > am missing? Or maybe I misunderstand the concept of call-used > registers. The function prologue code is responsible for saving registers which are not called used but which are modified by the function. Ian