Hi everyone,
Anyone knows why Codewarrior 10.1 compiler for Coldfire V1 generates much bigger code than Codewarrior 6.3 compiler?
I have both projects with the same code and the same optimization level (1 - smaller code size). The code generated by Codewarrior 6.3 is around 46KBytes and the code generated by Codewarrior 10.1 is around 60KBytes
I have attached the MAP files of both projects. You can look at functions and see that code generated by CodeWarrior 10.1 is bigger.
Regards,
Gustavo
已解决! 转到解答。
Hello,
I think I have found your problem: you missed to enable 'Register Coloring', 'Instruction scheduling' and 'Peephole' optimizations in MCU10.1. You have them enabled in 6.3, but not in 10.1.
I replicated this on my side, and with above optimizations enabled the code size in my f_mount() was reduced from 0x52.
to 0x2d. So this should make the difference you expect.
BK
Hard to tell from the map file only. I suggest that you pick one function (e.g. f_mount) and create a disassembly listing for both compilers.
There is for sure one big change from 6.3 to 10.1 projects (ColdFire): the library model has changed. But I think this is not the main reason. I think somehow your 10.1 options are not to the same optimization level as in 6.3.
Check if you have the same code and data model (e.g. far/near, etc) and as well if the stack frames (-A6) are the same.
You find these settings in 10.1 under the project settings > C/C++ Build > Settings > ColdFire Compiler > Processor.
BK
Hello,
I think I have found your problem: you missed to enable 'Register Coloring', 'Instruction scheduling' and 'Peephole' optimizations in MCU10.1. You have them enabled in 6.3, but not in 10.1.
I replicated this on my side, and with above optimizations enabled the code size in my f_mount() was reduced from 0x52.
to 0x2d. So this should make the difference you expect.
BK