Codewarrior 6.3 vs Codewarrior 10.1 compiler

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Codewarrior 6.3 vs Codewarrior 10.1 compiler

跳至解决方案
2,553 次查看
gustavod
Contributor III

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

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,873 次查看
BlackNight
NXP Employee
NXP Employee

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

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,873 次查看
BlackNight
NXP Employee
NXP Employee

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

0 项奖励
回复
1,873 次查看
gustavod
Contributor III

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

0 项奖励
回复
1,873 次查看
BlackNight
NXP Employee
NXP Employee

Could you check the ff_disassembly_CW10.1.txt? it is an empty file in the zip file?

 

BK

0 项奖励
回复
1,874 次查看
BlackNight
NXP Employee
NXP Employee

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

0 项奖励
回复
1,873 次查看
gustavod
Contributor III

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

0 项奖励
回复
1,873 次查看
gustavod
Contributor III

Forgive me BK. Now i posted the right files.

 

Regards,

Gustavo

0 项奖励
回复