Using the Interlist Utility With the Optimizer
3-13
Optimizing Your Code
3.6 Using the Interlist Utility With the Optimizer
You control the output of the interlist utility when running the optimizer (the
−
o
n
option) with the
−
os and
−
ss options.
-
The
−
os option interlists optimizer comments with assembly source state-
ments.
-
The
−
ss and
−
os options together interlist the optimizer comments and the
original C source with the assembly code.
When you use the
−
os option with the optimizer, the interlist utility does
not
run
as a separate pass. Instead, the optimizer inserts comments into the code,
indicating how the optimizer has rearranged and optimized the code. These
comments appear in the assembly language file as comments starting with ;**.
The C source code is not interlisted, unless you use the
−
ss option also.
The interlist utility can affect optimized code because it might prevent some
optimization from crossing C statement boundaries. Optimization makes
normal source interlisting impractical, because the optimizer extensively rear-
ranges your program. Therefore, when you use the
−
os option, the optimizer
writes reconstructed C statements.
3.7 Debugging Optimized Code
Ideally, you should debug a program in an unoptimized form and reverify its
correctness after it has been optimized. You can use the debugger with opti-
mized code, but the optimizer’s extensive rearrangement of code and the
many-to-one allocation of variables to registers often makes it difficult to corre-
late source code with object code.
Note: Symbolic Debugging and Optimized Code
If you use the
−
g option to generate symbolic debugging information, many
code generator optimizations are disabled because they disrupt the debug-
ger. If you want to use symbolic debugging and still generate fully optimized
code, use the
−
mn option.
−
mn re-enables the optimizations disabled by
−
g.
Using the Interlist Utility With the Optimizer / Debugging Optimized Code
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...