The option is safe, but makes debugging more difficult. Typically, the C compiler outputs code that stores in the regular register ( ebp on x86) a pointer to the stack stack for the function. Debuggers use this to print the local contents of a variable and other such information. The -fomit-frame-pointer flag tells gcc not to worry about this case. In some situations, this can lead to a small increase in performance, mainly due to a decrease in code length (which is better for the cache) and an additional available register (especially on x86 in 32-bit mode, which, as you know, is starving on registers).
Thomas pornin
source share