Debugging Options Overview

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 enables 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 disabled 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 without turning off optimization, so that a debugger can still produce a stack backtrace. Using this option disables use of the EBP register in optimizations, and can result in slightly less efficient code.

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