-OdocF: Dynamic Option Configuration for Functions

Group

OPTIMIZATIONS

Scope

Function

Syntax
-OdocF="<option>"

Arguments

<option>: Set of options, separated by `|'> to be evaluated for each single function.

Default

None

Defines

None

Pragmas

None

Description

Normally, you must set a specific set of Compiler switches for each compilation unit (file to be compiled). For some files, a specific set of options may decrease the code size, but for other files, the same set of Compiler options may produce more code depending on the sources.

Some optimizations may reduce the code size for some functions, but may increase the code size for other functions in the same compilation unit. Normally it is impossible to vary options over different functions, or to find the best combination of options.

This option allows the Compiler to choose from a set of options to reach the smallest code size for every function. Without this feature, you must set fixed Compiler switches over the whole compilation unit. With this feature, the Compiler finds the best option combination from a user-defined set for every function.

Standard merging rules apply for this option:

-Or -OdocF="-Ocu|-Cu"

This is the same as:

-OrDOCF="-Ouc|-Cu"

The Compiler attempts to find the best combination of the specified options and evaluates all possible combinations of all specified sets, for example, for the option shown in the followingthe following listing.

Listing: Example of Dynamic Option Configuration
-W2 -OdocF="-Or|-Cni -Cu|-Oc"


The Compiler evaluates code sizes for the following option combinations:

1. -W2

2. -W2  -Or

3. -W2      -Cni -Cu

4. -W2  -Or -Cni -Cu

5. -W2               -Oc

6. -W2  -Or          -Oc

7. -W2      -Cni -Cu     -Oc

8. -W2  -Or -Cni -Cu       -Oc

The Compiler evaluates all combinations. Thus, specifying more sets takes more evaluation time (for example, for five sets 32 evaluations).

Note: Do not specify options with scope Application or Compilation Unit (as memory model, float or double format, or object-file format) or options for the whole compilation unit (like inlining or macro definition) in this option. The generated functions may be incompatible for linking and executing.

Limitations :

Example
-Odocf="-Or|-Cni"