Translations:GCC optimization/50/en

From Gentoo Wiki
Jump to:navigation Jump to:search

This is a very common flag designed to reduce generated code size. It is turned on at all levels of -O (except -O0) on architectures where doing so does not interfere with debugging (such as x86-64), but it may need to be activated. In that case add it to the flags. Though the GCC manual does not specify all architectures, it is turned on by using the -O option. It's still necessary to explicitly enable the -fomit-frame-pointer option to activate it on x86-32 with GCC up to version 4.6, or when using -Os on x86-32 with any version of GCC. However, using -fomit-frame-pointer will make debugging hard or impossible. It is worth noting that this option is not enabled by default when using Clang. It is also worth noting that keeping frame pointers is actually beneficial when profiling a code base, and in this case users may want to disable this through -fno-omit-frame-pointer.