-qoptdebug

Category

Error checking and debugging

@PROCESS

None.

Purpose

When used with high levels of optimization, produces files containing optimized pseudocode that can be read by a debugger.

An output file with a .optdbg extension is created for each source file compiled with -qoptdebug. You can use the information contained in this file to help you understand how your code actually behaves under optimization.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nooptdebug-.   
>>- -q--+-optdebug---+-----------------------------------------><

Defaults

-qnooptdebug

Usage

-qoptdebug only has an effect when used with an option that enables the high-level optimizer, namely -O3 or higher optimization level, or -qhot, -qsmp, -qpdf, or -qipa. You can use the option on both compilation and link steps. If you specify it on the compile step, one output file is generated for each source file. If you specify it on the -qipa link step, a single output file is generated.

The naming rules of a .optdbg file are as follows:
  • If a .optdbg file is generated at the compile step, its name is based on the output file name of the compile step.
  • If a .optdbg file is generated at the link step, its name is based on the output file name of the link step.

If you compile and link in the same step using the -qoptdebug option with -qipa, the .optdbg file is generated only at the link step.

You must still use the -g or -qlinedebug option to include debugging information that can be used by a debugger.

For more information and examples of using this option, see Using -qoptdebug to help debug optimized programs.

Related information