Program-wide Analysis and Optimization
4-11
4
This causes the object modules in the program to be compiled and then
linked with the options in the
FLAGS macro. The make tool then issues the
following commands:
ic960 -c -Ttarg -fdb -gcdm,subst=*:*+O5,iprof= fee.c
ic960 -c -Ttarg -fdb -gcdm,subst=*:*+O5,iprof= foo.c
ic960 -o prog -Ttarg -fdb -gcdm,subst=*:*+O5,iprof=
fee.o foo.o
The link command causes substitution modules at optimization level O5 to
be built in the PDB to replace the original modules
fee.o and foo.o in
the program load module
prog. The iprof= option without a filename
indicates that you are not using a profile, which is the default behavior.
Building for Debugging without Program-wide Optimizations
If logic problems exist in the program, you can build a debug version of
prog by invoking the make tool with:
make SUBST=g+O0
This causes the make tool to issue only the following link command
(assuming the sources haven’t changed):
ic960 -o prog -Ttarg -fdb -gcdm,subst=*:*+g+O0,iprof=
fee.o foo.o
The link command causes substitution modules with no optimization and
full debug information to be built in the PDB to replace the original
modules
fee.o and foo.o in the program load module prog.
After debugging the problem and then fixing it by changing one of the
source files, you can reissue the
make SUBST=O5 command to get another
program-wide optimized version of
prog. Invoking the make tool
recompiles the changed source file and then links the program with the
O5
substitution specification, as before. This causes the global decision
making and optimization step to recompile the previous
O5 substitution
modules as needed in the PDB, and those modules are then used in the
program load module
prog.