Hello,
I'm using keil 3.4, optimization O3, cross module optimization.
I deleted all the objects files, listings... before compiling.
The first time I build the project, the code size is more than 11KB.
The second time ~7.7 KB.
The third time ~7.5
After that, it didn't change anymore.
No change was made between those builds. I just clicked the build button 3 times and it gave me 3 different code size.
I suppose it related to the using of cross-module optimization; but it's really strange.
Any clue?
Thanks,
That would of course depend on your need for optimum optimization. In most situations, it is enough to just get "good enough" optimization. Fast enough to solve the problem in required time frame, and small enough that it fits in the chip and doesn't result in too large transfer costs if doing over-the-air updates.
A more important issue is that you have a policy how to build your project, so that you can - at a later time - rebuild the project and reproduce the same binary (with possible exception of build time stamp).