When you use debugging options to generate code with debug symbols, the compiler disables On optimizations. If you specify an On option with debugging options, some of the generated debug information may be inaccurate as a side-effect of optimization.
The table below summarizes the effects of using the debugging options with the optimization options.
Option(s) | Result |
---|---|
-g | Debugging information produced, -O0 and -fp enabled. |
-g -O1 | Debugging information produced, -O1 optimizations enabled. |
-g -O2 | Debugging information produced, -O2 optimizations enabled. |
-g -O3 -fp | Debugging information produced, -O3 optimizations and -fp are enabled. |