Program-wide Analysis and Optimization
4-3
4
The PDB can be specified by setting the environment variable G960PDB
(gcc960 driver) or I960PDB (ic960 driver) to the correct location. You
can also specify the PDB at compiler invocation time with the
Z
dir
(gcc960) or Yd,
dir
(ic960) option, as shown in the examples below.
gcc960 -Zmypdb foo.o
ic960 -Yd,mypdb foo.o
Compiling for Program-wide Optimization with the
fdb Option
All modules subject to program-wide optimization must be initially
compiled with the
fdb option (described in Chapter 2, gcc960 Driver and
Chapter 3, ic960 Driver). Using this option causes the insertion of
program database information in the object modules, and it implies a
minimum module-local optimization level of
O1 (although higher module-
local optimization levels are allowed).
Compiling with the
fdb option does not change the code or data generated
for the object modules in any way; this option simply makes information
collected during the initial compilation of the modules available to the
global decision making and optimization step.
Global Decision Making and Optimization Using the
gcdm Option
The tool that performs the global decision making and optimization step is
called gcdm960. gcdm960 is invoked from within the linker when the
gcdm option is used. You can also use the gcdm option in the compiler
driver (gcc960 or ic960) to pass this option to the linker. Using the
gcdm
option causes gcdm960 to:
• automatically build and manage optimized object modules in the PDB
• arrange with the linker for optimized object modules from the PDB to
be automatically substituted for some or all of the original object
modules in the final program.