|Home > Migrating from Arm Compiler 5 to Arm Compiler 6 > Optimization differences|
Arm® Compiler 6 provides more performance optimization settings than are present in Arm Compiler 5. However, the optimizations that are performed at each optimization level might differ between the two toolchains.
The table compares the optimization settings and functions in Arm Compiler 5 and Arm Compiler 6.
Table 2-2 Optimization settings
|Description||Arm Compiler 5||Arm Compiler 6|
|Optimization levels for performance.||
|Optimization levels for code size.||
|Best trade-off between image size, performance, and debug.||
|Highest optimization for performance||
|Highest optimization for code size||
Arm Compiler 6 provides
an aggressive optimization setting,
automatically enables a feature called Link Time Optimization. For more information,
armclang can perform link time optimizations that were not possible in
Arm Compiler 5. These
link time optimizations can expose latent bugs in the final image. Therefore, an
image built with Arm Compiler
5 might have a different behavior to the image built with Arm Compiler 6.
For example, unused variables without the
volatile keyword might be removed when using
-Omax in Arm Compiler 6. If the unused variable is actually a volatile variable
that requires the
volatile keyword, then the
removal of the variable can cause the generated image to behave unexpectedly. Since
Arm Compiler 5 does not
have this aggressive optimization setting, it might not have removed the unused
variable, and the resulting image might behave as expected, and therefore the error
in the code would be more difficult to detect.