We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
void function1(void){... // Optimized at O1 (from armcc -O1)}#pragma push#pragma O3void function2(void){... // Optimized at O3}#pragma popvoid function3(void){... // Optimized at O1 (from armcc -O1)}
How do we find an alternative way?
Hello
I have moved your question to the Compilers and Libraries forum.
Thanks
Oli from the Community team
More info here. See the row for "#pragma Onum" : "armclang does not support changing optimization options within a file. Instead these must be set on a per-file basis using command-line options."
armclang
disappointed. that means I cannot set different Onum for a section in a source file. It's a backslide . ARM Complier V5. is better and stronger.
I want to set different levels of optimization for different sections In a C source file
I found some error on O1 in Complier 6.16 for a whole C source , but I need some section O1. the other part use O0.
disappointed. that means I cannot set different Onum for a section in a source file?
The single C source file can be broken up into multiple C files, so that the Onum option can be applied at a file level.
earth-boy111 said:I found some error on O1 in Complier 6.16 for a whole C source
If your program displays different logical behaviour when compiling with different optimization options, then the program is likely to have a bug.