Content originally posted in LPCWare by Rob65 on Tue Feb 05 01:17:36 MST 2013
Quote: micrio
Are you suggesting that giving the -O3 is not actually
giving me full speed optimization?
Never assume that a higher optimization level gives you a higher speed.
There are different settings for speed and size optimization and, as I stated before, the LPCXpresso 4 tools are standard set to -O2 whereas 5 uses -Os, which is optimizing for size rather than speed.
It used to be such that -O1 did some optimization, -O2 optimized for speed, -O3 for size and speed and -Os was for the smallest code size.
-O3 delivered code that lies somewhere between -O2 and -Os, so not as small as -Os and not as fast as -O2.
But please remember that this is just a rule of thumb. Depending on your program this may differ.
When it comes to execution speed you should really try different settings and different structuring in your C program to see what is best for a specific function.
And then carefully check if a new LPCXpresso tool version incorporates a new gnu-arm compiler since optimizations may differ slightly between versions.
Rob