Hi,
I am new to coding environment. My question is reading the optimization levels in build command. In some documents and sample code i have seen the build command as shown below, in which the two optimization level is given in a build command.
armclang --target=arm-arm-none-eabi -Oz -O2
1) Is this method is correct? can i give multiple optimization level in single build command
2) I am getting liker error(the code will not fit in flash) while using command a shown above. But the code will build if the optimization order is changed(armclang --target=arm-arm-none-eabi -O2 -Oz). Why it the code is buildable while changing the order of optimization level.
3) With ac6 is it possible to set optimization level(-O0, -O2, -O3) and optimization for ( -Oz, -Os)
Best Regards
Ranjith
Hi Ranjith,
The compiler will only use one optimization option. If you specify multiple on a command line, the lattermost will be used.The below explains the relationship between the different optimization options:
https://developer.arm.com/documentation/101754/0624/armclang-Reference/armclang-Command-line-Options/-O--armclang-
Regards, Ronan