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.

IAR Embedded Workbench 6.20 generates larger codesize than 5.51

Other Parts Discussed in Thread: MSP430F5528

All:

Recently, I was asked to update from an older IAR Workbench to the newest. I am able to create a project and transfer the project settings, and even download and run the newly build project. The RAM size of the new project is very close to the one built with IAR 5.51 - however, when I looked at the amount of code being put into flash, the size went from ~20000 to ~28000 bytes. I am exploring why this happened, but I would like to know if someone else has seen this size increase.

I am using MSP430F5528.

Perplexed...

  • Probably some defaults have changed and the new defaults include more runtime library support than the old compiler. Or does less optimization.
    A typical example is the printf support. Full support (including float) significantly increases the code size.
    Instruct the linker to generate a map file and then look there where the additional output comes from. Ideally by comparing it to a map file of the old compiler run.
  • Jens:
    There is an interersting array of sizes - I am showing a very large size difference based on compiler options. I concentrated on "high" optimization code sizes, here is an array:
    Optimization IAR 5.51 IAR 6.20
    High, Size 18034 17682
    High, Balanced 18060 18248
    High, Speed 20042 21862High, Speed, No
    size constraints 20058 28164
    So, it indeed looks like there are larger variations in size on the newer compiler. (I am not against that. However, if I look at the Balanced and Speed, they are similar in size.
    Overall, I the 6.20 code does run on my target, so there is no degradation when moving from 5.51 to 6.20 - I felt that I owed you some clarification on code sizes...
    High,
  • Sorry, E2E took removed my spaces, so that my nice columns went away...
  • Okay, again, with Rich Formatting:

    Optimizations         IAR 5.51        IAR 6.20

    High, Size             18034           17682

    High, Balanced         18060           18248

    High, Speed            20042           21862

    High, Speed, No Size   20058           28164

      Constraints

     

    Again, as you can see, there is a rather narrow range on 5.51 code, and a much wider range on the 6.20 code.

    And, the newer code works on the target.

  • Todd Anderson78572 said:

    Again, as you can see, there is a rather narrow range on 5.51 code, and a much wider range on the 6.20 code.

    And, the newer code works on the target.

    Hi, this is the expected behavior. We are working hard on optimizing the compiler. However, with a compiler as mature as IAR compiler, it's somewhat hard to find new optimizations that makes the code both smaller and faster. Instead, we have put an effort into making the speed-optimized code faster at the expense of code size, and vice verse.
        -- Anders Lindgren, IAR Systems
  • Anders:

    Thank you for your response, and for all of your hard work! By running several of the options, I was able to see the variations.

    One question - how are you able to make a variable visible in IAR 6.20? I see this as a very useful feature and it gives a realtime aspect that I have not seen from the IDE perspective. (Data Sample Setup, Data Sample, Sampled Graphs)

**Attention** This is a public forum