Skip to main content

IAR Embedded Workbench for RISC-V 3.40

-O

In this section:
Syntax
-O[n|l|m|h|hs|hz] 
Parameters

n

None* (Best debug support)

l (default)

Low*

m

Medium

h

High, balanced

hs

High, favoring speed

hz

High, favoring size

*All optimizations performed at level Low will be performed also at None. The only difference is that at level None, all non-static variables will live during their entire scope.

Description

Use this option to set the optimization level to be used by the compiler when optimizing the code. If no optimization option is specified, the optimization level Low is used by default. If only -O is used without any parameter, the optimization level High balanced is used.

A low level of optimization makes it relatively easy to follow the program flow in the debugger, and, conversely, a high level of optimization makes it relatively hard.

See also

Controlling compiler optimizations.

Caution

Project>Options>C/C++ Compiler>Optimizations