-ffixed-reg
Treat the register named reg as a fixed register; generated code should never
refer to it (except perhaps as a stack pointer, frame pointer or in some other
fixed role).
reg must be the name of a register. The register names accepted are machinespecific
and are defined in the REGISTER_NAMES macro in the machine description
macro file.
This flag does not have a negative form, because it specifies a three-way choice.
如uboot 的arm64 使用-ffixed-x18,gcc编译的代码将不会使用x18寄存器,x18在uboot中作为全局数据的指针使用。
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("x18")