Debugging Options Summary

For compilations targeted to IA-32 processor systems, the compiler uses -O0 as the default when you specify -g. Specifying the -g or -O0 option automatically disables the -fp option for IA-32-targeted compilations. (Option -fp is not used for compilations targeted for Itanium(TM)-based systems.)

The -fp option (applies to IA-32 compilations only) is enabled by default or when -O1 or -O2 is specified and allows the compiler to use the ebp register as a general purpose register in optimizations. However, most debuggers expect ebp to be used as a stack frame pointer, and cannot produce a stack backtrace unless this is so. The -fp- option instructs the compiler to generate code for IA-32-targeted compilations that maintains and uses ebp as a stack frame pointer, without turning off optimization, so that a debugger can still produce a stack backtrace. Using this option reduces the number of available general purpose registers by one, and can result in slightly less efficient code.

Options Descriptions
-g Debugging information produced, -O0 enabled, -fp disabled for IA-32-targeted compilations.
-g -O2 Debugging information produced, -O2 optimizations enabled.
-g -O3 -fp- Debugging information produced, -O3 optimizations enabled, -fp disabled for IA-32-targeted compilations.
-g -ip Limited debugging information produced, -ip option enabled.