|Home > Compiler Command-line Options > -fomit-frame-pointer, -fno-omit-frame-pointer|
-fomit-frame-pointer omits the storing of stack frame pointers during function calls.
-fomit-frame-pointer option instructs
the compiler to not store stack frame pointers if the function does not need it. You can use
this option to reduce the code image size.
instructs the compiler to store the stack frame pointer in a register. In AArch32, the frame
pointer is stored in register
R11 for A32 code or register
R7 for T32 code. In AArch64, the frame pointer is stored
X29. The register that is used as a frame
pointer is not available for use as a general-purpose register. It is available as a
general-purpose register if you compile with
Frame pointers enable the compiler to insert code to remove the automatic variables from the stack when C++ exceptions are thrown. This is called stack unwinding. However, there are limitations on how the frame pointers are used:
-fno-omit-frame-pointer, then any function which uses space on the stack creates a frame record, and changes the frame pointer to point to it. There is a short time period at the beginning and end of a function where the frame pointer points to the frame record in the caller's frame.
-fno-omit-frame-pointer, then the frame pointer always points to the lowest address of a valid frame record. A frame record consists of two words:
The default is