I ran a test where I change the optimization level from 0 to 2. I look at the link file before and afer the code size did not change. Is there another setting to allow optimization?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I ran a test where I change the optimization level from 0 to 2. I look at the link file before and afer the code size did not change. Is there another setting to allow optimization?
The optimizer is not a magic bullet. It follows certain steps to optimize code (see page 48 of the C/C++ Compiler guide). If there are none of the things that can be optimized out in your code, nothing will change.
A couple of other points/questions:
1) How big is the code you are optimizing? The bigger the code is the greater the chance of it finding something to be optimized.
2) Optimization Level 0 is already optimizing. Sticking it to O2 does a few more things, and as stated above these may not be in your code. Have a go at turning optimization off completely (in the project build settings) and then seeing whether your map file has changed (code size has got bigger). This is more likely to show a change and indicate that there is something happening in optimization.
Tim