Compiling C/C++ Code
3-4
3.2
Compiling C/C++ Code
The ’C6000 compiler offers high-level language support by transforming your
C/C++ code into more efficient assembly language source code. The compiler
tools include a shell program (cl6x), which you use to compile, assembly opti-
mize, assemble, and link programs in a single step. To invoke the compiler
shell, enter:
cl6x [
options] [filenames] [–z [linker options] [object files]]
For a complete description of the C/C++ compiler and the options discussed
in this chapter, see the
TMS320C6000 Optimizing C/C++ Compiler User’s
Guide (SPRU187).
3.2.1
Compiler Options
Options control the operation of the compiler. This section introduces you to
the recommended options for performance, optimization, and code size. Con-
siderations of optimization versus performance are also discussed.
The options described in Table 3–1 are obsolete or intended for debugging,
and could potentially decrease performance and increase code size. Avoid us-
ing these options with performance critical code.
Table 3–1. Compiler Options to Avoid on Performance Critical Code
Option
Description
–g/–s/
–ss/–gp
These options limit the amount of optimization across C state-
ments leading to larger code size and slower execution.
–mu
Disables software pipelining for debugging. Use –ms2/–ms3
instead to reduce code size which will disable software pipelin-
ing among other code size optimizations.
–o1/–o0
Always use –o2/–o3 to maximize compiler analysis and opti-
mization. Use code size flags (–ms
n) to tradeoff between per-
formance and code size.
–mz
Obsolete. On pre–3.00 tools, this option may have improved
your code, but with 3.00+ compilers, this option will decrease
performance and increase code size.