Hello,
i have checked out the code size and maximal stack usage (from the static call graph) for a Cortex M0+ project compiled with ARM Compiler 6 and different optimization levels.
To compare I added the results with compiler 5 and optimisation level 1.
The following table shows the results.
Optimize Level LTO Static call graph max. stack usage Code memory1 no 696 byte 85604 byte1 yes 856 byte 103084 byte2 no 704 byte 98228 byte2 yes 952 byte 121824 byte3 no 704 byte 103728 byte3 yes 1000 byte 129724 bytefast no 704 byte 103724 bytefast yes 1000 byte 129724 bytebalanced no 688 byte 82952 bytebalanced yes 824 byte 78740 byteOz image size no 696 byte 77788 byteOz image size yes 792 byte 69792 byte
Comp. 5 Opt. 1 460 byte 79560 byte
I have three questions to the results:
- why does LTO increase the code footprint for optimization levels 1, 2, 3 and fast? I would expect a code reduction as for the levels balanced an Oz.
- why does LTO increase the stack usage? This happens in all optimization levels.
- In general the stack usage with compiler 6 is significantly larger as with Compiler 5. Do I miss something here?
Best regards for your support.
Joachim