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
Solved! Go to Solution.
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
Hi BlackNight,
Thank you by your help, but i think that all configs are the same. I have attached the images and the disassembly for both compilers of the ff.c file.
Regards,
Gustavo
Could you check the ff_disassembly_CW10.1.txt? it is an empty file in the zip file?
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
Thank you very much BK. Now both codes are in the same size. On monday i will try the Code Warrior 10.1 code in my board, but i think that everything will work.
Best regards,
Gustavo
Forgive me BK. Now i posted the right files.
Regards,
Gustavo