Optimizer Assistant Advice: Detecting low optimization.

Typical Advice

 #27008-D Detecting compilation with low optimization. Recommend setting --opt_level=3. NOTE: debug ability will decrease.

Why is the Compiler giving this Advice ?

Your compilation uses low-level optimization options (-o2 and below). This prevents the compiler from using its most powerful optimization techniques, since the -o (--opt_level) options are the foundations for most other optimizations. You could get substantially better performance using -o3 (or above) optimization.

NOTE: debug ability will decrease with increased optimization levels. For details see:

What it means:

The C/C++ compiler is able to perform various optimizations, but you need to specify optimization options on the command line so that these optimizations are performed. The easiest way to invoke optimization is to specify the --opt_level=n option on the compiler command line. You can use -On to alias the --opt_level option. The n denotes the level of optimization (0, 1, 2, 3, and 4), which controls the type and degree of optimization.

--opt_level=off or -Ooff

--opt_level=0 or -O0

--opt_level=1 or -O1 : Performs all --opt_level=0 (-O0) optimizations, plus:

--opt_level=2 or -O2 : Performs all --opt_level=1 (-O1) optimizations, plus:

--opt_level=3 or -O3 : Performs all --opt_level=2 (or -O2) optimizations, plus:Italic text* Removes all functions that are never called

--opt_level=4 or -O4

Note that -o defaults to -o2 (-o3 for ARM). In the absence of any -o options, MSP430 is set to -o0, ARM is set to -o3, and C2000 is set to -ooff.

For more information, see:

Risks, Severity

Use -o3 or higher optimization to see performance improvements.

Suggested Action

Compile with options -o3 or higher.

E2e.jpg For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Compiler/diagnostic messages/27008 here.