Microchip Technology SW006023-1N Data Sheet

Page of 238
MPLAB
®
 XC32 C/C++ Compiler User’s Guide
DS51686E-page 76
 2012 Microchip Technology Inc.
Options of the form -fflag specify machine-independent flags. Most flags have both 
positive and negative forms. The negative form of -ffoo would be -fno-foo. In the 
table below, only one of the forms is listed (the one that is not the default.) 
TABLE 3-13:
MACHINE-INDEPENDENT OPTIMIZATION OPTIONS
Option
Definition
-fforce-mem
Force memory operands to be copied into registers 
before doing arithmetic on them. This produces better 
code by making all memory references potential common 
subexpressions. When they are not common 
subexpressions, instruction combination should eliminate 
the separate register load. The -O2 option turns on this 
option.
-finline-functions
Integrate all simple functions into their callers. The 
compiler heuristically decides which functions are simple 
enough to be worth integrating in this way. If all calls to a 
given function are integrated, and the function is declared 
static
, then the function is normally not output as 
assembler code in its own right.
-finline-limit=n 
By default, the compiler limits the size of functions that 
can be inlined. This flag allows the control of this limit for 
functions that are explicitly marked as inline (i.e., marked 
with the inline keyword). 
n
 is the size of functions that 
can be inlined in number of pseudo instructions (not 
counting parameter handling). The default value of n is 
10000. Increasing this value can result in more inlined 
code at the cost of compilation time and memory 
consumption. 
Decreasing usually makes the compilation faster and 
less code is inlined (which presumably means slower 
programs). This option is particularly useful for programs 
that use inlining.
Note: Pseudo instruction represents, in this particular 
context, an abstract measurement of function's size. In 
no way does it represent a count of assembly instructions 
and as such, its exact meaning might change from one 
release of the compiler to an another.
-fkeep-inline-functions
Even if all calls to a given function are integrated, and the 
function is declared static, output a separate run time 
callable version of the function. This switch does not 
affect extern inline functions.
-fkeep-static-consts
Emit variables are declared static const when 
optimization isn't turned on, even if the variables are not 
referenced. 
The compiler enables this option by default. If you want 
to force the compiler to check if the variable was 
referenced, regardless of whether or not optimization is 
turned on, use the -fno-keep-static-consts 
option.
-fno-function-cse
Do not put function addresses in registers. Make each 
instruction that calls a constant function contain the 
function's address explicitly. 
This option results in less efficient code, but some 
strange hacks that alter the assembler output may be 
confused by the optimizations performed when this 
option is not used.