C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-72
OPTIMIZE
Each line of the optimizer file can contain only one function name and the optimize
level (0,1, or 2) that you want for that function.
The optimizer file can raise or lower the optimize level for the given functions; the
other functions in the module are compiled at the optimization level specified in the
RUN command line, if any is specified, or at the default level if no level is specified.
The function name must be the internal name used for linking by the linker utility.
Therefore, the mangled name must be used for C++ programs.
OPTIMIZE
The OPTIMIZE pragma controls the level to which the compiler optimizes the object
code.
level
specifies the level to which the compiler optimizes the code it generates. The
available optimization levels are described in Usage Guidelines.
The pragma default settings are:
Usage Guidelines
For TNS and native C and C++, the OPTIMIZE pragma can be only entered on the
compiler RUN command line. For OSS, the pragma can be specified with the
-Woptimize flag of the c89 utility.
The OPTIMIZE pragma affects TNS C and C++ programs:
°
Optimization level 0 disables all optimizations and yields code with relatively
poor performance. It does not reduce compilation time.
°
Optimization level 1 provides intrastatement optimizations; that is,
optimizations within a single statement but not across statement boundaries.
OPTIMIZE level
level:
{ 0 |1 | 2 }
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler OPTIMIZE 1 OPTIMIZE 1
G-series TNS c89 utility OPTIMIZE 1 OPTIMIZE 1
TNS/R native C and C++ compilers OPTIMIZE 1 OPTIMIZE 1
Native c89 utility OPTIMIZE 1 OPTIMIZE 1
TNS/E native C and C++ compilers OPTIMIZE 1 OPTIMIZE 1