The compiler optimization can't reduce the number of memory allocation/creations and other memory related operations. In your case, it is reasonable to investigate profiling logs and your code in order to optimize the usage of costly operations. Generally, these C/C++ optimization rules are common for any computing platform and you can find many articles and discussions on this topic.
http://stackoverflow.com/questions/470683/memory-allocation-deallocation-bottleneck
http://stackoverflow.com/questions/2555402/c-performance-memory-optimization-guidelines
http://www.tantalon.com/pete/cppopt/final.htm
http://en.wikibooks.org/wiki/Optimizing_C%2B%2B/Writing_efficient_code/Allocations_and_deallocations
The last thing to do is to improve memory related operations themselves (heap manager, memcpy, strings...).
CodeWarrior runtime library:
"
A hand optimized version of memcpy is available in
PowerPC_EABI_Support/Runtime/Src/__mem.c
It is turned OFF by default. User could manually turn it ON by
#define USE_FAST_MEMCPY 1
and rebuilding the runtime libraries. Fast memcpy would then be enabled only if
the target processor support:
- lfd/stfd instructions and floating point support is ON
OR
- evldd/evstd instructions
*** Please note that there is a code size tradeoff when enabling fast memcpy as
compared to original memcpy
"
Have a great day,
Pavel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------