Codewarrior 6.3 vs Codewarrior 10.1 compiler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Codewarrior 6.3 vs Codewarrior 10.1 compiler

Jump to solution
1,759 Views
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

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,079 Views
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

View solution in original post

0 Kudos
Reply
6 Replies
1,079 Views
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 Kudos
Reply
1,079 Views
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 Kudos
Reply
1,079 Views
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 Kudos
Reply
1,080 Views
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 Kudos
Reply
1,079 Views
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 Kudos
Reply
1,079 Views
gustavod
Contributor III

Forgive me BK. Now i posted the right files.

 

Regards,

Gustavo

0 Kudos
Reply