优化你的软件时,发觉"-fomit-frame-pointer"这个选项还是蛮有用的。
GCC手册上面这么说:
Don't keep the frame pointer in a register for functions that don't need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions. It also makes debugging impossible on some machines.
On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn't exist. The machine-description macro "FRAME_POINTER_REQUIRED" controls whether a target machine supports this flag.
这里,引入了一个"frame pointer"的概念,什么是"stack frame pointer(SFP)"呢?