Optimization levels
The compiler supports different levels of optimizations. This table lists optimizations that are typically performed on each level:
Note
Some of the performed optimizations can be individually enabled or disabled. For more information, see Fine-tuning enabled transformations.
A high level of optimization might result in increased compile time, and will also most likely make debugging more difficult, because it is less clear how the generated code relates to the source code. For example, at the low, medium, and high optimization levels, variables do not live through their entire scope, which means processor registers used for storing variables can be reused immediately after they were last used. Due to this, the C-SPY Watch window might not be able to display the value of the variable throughout its scope, or even occasionally display an incorrect value. At any time, if you experience difficulties when debugging your code, try lowering the optimization level.