Performing Program-Level Optimization (
−
pm and
−
o3 Options)
3-7
Optimizing Your Code
Table 3
−
4. Selecting a Level for the
−
op Option
If your module
…
Use this option
Has functions that are called from other modules and global vari-
ables that are modified in other modules
−
op0
Does not have functions that are called by other modules but has
global variables that are modified in other modules
−
op1
Does not have functions that are called by other modules or glob-
al variables that are modified in other modules
−
op2
Has functions that are called from other modules but does not
have global variables that are modified in other modules
−
op3
In certain circumstances, the compiler reverts to a different
−
op level from the
one you specified, or it might disable program-level optimization altogether.
Table 3
−
op levels and conditions that cause the
compiler to revert to other
−
op levels.
Table 3
−
5. Special Considerations When Using the
−
op Option
If your
−
op is... Under these conditions...
Then the
−
op
level...
Not specified
The
−
o3 optimization level was specified
Defaults to
−
op2
Not specified
The compiler sees calls to outside functions
under the
−
o3 optimization level
Reverts to
−
op0
Not specified
Main is not defined
Reverts to
−
op0
−
op1 or
−
op2
No function has main defined as an entry
point
Reverts to
−
op0
−
op1 or
−
op2
No interrupt function is defined
Reverts to
−
op0
−
op1 or
−
op2
Functions are identified by the
FUNC_EXT_CALLED pragma
Reverts to
−
op0
−
op3
Any condition
Remains
−
op3
In some situations when you use
−
pm and
−
o3, you
must
use an
−
op option
or the FUNC_EXT_CALLED pragma. See section 3.3.2,
Optimization Consid-
erations When Mixing C and Assembly
, on page 3-8 for information about
these situations.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...