This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Difference in code size between 6.2.7 and 6.4.9

I have a 28069 project which build and links fine under 6.2.11 however attempting the same build using 6.4.9 results in code too large to fit in flash. I've combed the map file and there's not a glaring increase of any single object file. Instead there's a slight increase in the size of every object file.

This project contains mostly cpp files but I'm also building MWare from source at the same time and those object files increase too (not fair comparison though because MWare has been updated between these two builds).

I've tried building with --C89 without any change.

Here are the first few lines from the map files for each build:

6.2.7

                  003d8000    0000295d     SoundEngine.obj (.text)

                  003da95d    00002045     FrontPanel.obj (.text)

                  003dc9a2    000011df     MidiDevice.obj (.text)

                  003ddb81    00000dd1     usblib.lib : usbhostenum.obj (.text)

                  003de952    000009ba     rts2800_fpu32.lib : _printfi.obj (.text)

                  003df30c    000008fb     Globals.obj (.text)

6.4.9

                  003d8000    00002e88     SoundEngine.obj (.text)

                  003dae88    0000229c     FrontPanel.obj (.text)

                  003dd124    00001455     MidiDevice.obj (.text)

                  003de579    00000001     rts2800_fpu32.lib : newhandler.obj (.text)

                  003de57a    00000c01                       : _printfi.obj (.text)

                  003df17b    00000974     Globals.obj (.text)

I can obviously force the project to build with the old tools but I'd like to understand this issue.

Thanks!

  • I have two suggestions to consider.  One ... Another way to see where the code growth may come from is described in this wiki article.  Two ... Try out the Optimizer Assistant as a way to experiment with compiler options and see how much difference it makes.

    Thanks and regards,

    -George

  • Thanks, George. I ran the Optimization Assistant as recommended and it indeed has a drastic effect on compiled code size. Following the steps in the link you provided I determined that Global Optimization with a speed/size setting of '2' is the best. The code now fits, runs, and I have much more flash left over than when using the old CGT with no optimization.

    Thanks again!