Chapter Contents |
Previous |
Next |
SAS/C Cross-Platform Compiler and C++ Development System User's Guide, Release 6.50 |
Global Optimization Compiler Options |
The
-O
compiler option is used to enable global optimization. The following options alter the behavior of the global optimizer.
Each of these options is described in Compiling C and C++ Programs .
Global Optimization and the Debugger |
The cross-platform compiler does not optimize programs when the
-g
option is used. To use all the capabilities of the SAS/C Debugger, there must be an accurate correspondence between object code and source line numbers, and
optimizations can alter this correspondence. Also, the
-g
option causes the compiler to suppress allocation of variables to registers, so the resulting code is not completely optimal.
You can, however, use the
-Kdbhook
option along with the
-O
option to generate optimized object code that can be used with the debugger. The
-Kdbhook
option generates hooks in the object code that enable the debugger to gain control of an executing program.
When using the debugger with optimized object code that has
been compiled with the
-Kdbhook
option, the source code is not displayed in the debugger's Source window and you cannot access variables. Therefore, the debugger's
print
command, and other commands, which are normally used with variables, are not used when debugging
optimized code. However, source code line numbers are displayed in the Source window, providing an indication of your location in the code. You also have the capability of viewing register values in
the debugger's Register window, and you can use commands such as
step
,
goto
, and
runto
to control the execution of your program. However, due to optimizations that affect register contents, the
goto
command may fail when debugging optimized code.
See Cross-Debugging for more information about using the SAS/C Debugger with the SAS/C Cross-Platform Compiler.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 1998 by SAS Institute Inc., Cary, NC, USA. All rights reserved.