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.

MSP430F149: Code Optimization

Part Number: MSP430F149

I am in the process of porting my regular CCS environment to a new MacBook (M1) and on this new system the generated code is not exactly  the same as on my current system. This is an issue for me because the code CRC is legally significant in this case.

I have two projects for generating my code, a library and a regular project, it is the library project (that I was not able to import in the new CCS) that has a slight difference in code, although CCS and compiler versions are the same and (so far I can see) all optimization settings are identical.

The code differences (at least one of the differences I was able to detect boils down to the following snippets:

Current system:

...
33a8:   12B0 33DC           CALL    #$abproc0
...
      $abproc0():
33dc:   403D 4B06           MOV.W   #0x4b06,R13
33e0:   12B0 4552           CALL    #operator <<
33e4:   4130                RET     

The compiler optimizes a couple of calls to the same routine with $abproc0.

On the new system the code looks like:

3338:   403D 4B38           MOV.W   #0x4b38,R13
333c:   12B0 4584           CALL    #operator <<

This happens a couple of times so indeed the other version saves a couple of bytes.

Does anyone have an idea what parameter/setting might incur this difference in generated code ?

  • Hi,

    The optimization setting might cause the problem. What optimization level you are using now on the project? Can you try with optimization level off and build the project?

    Best regards,

    Cash Hao

  • Yes, sure, it was. In fact there was a slight difference in size vs. optimization settings (0 vs. 1)  in both project. When the value is 1 this is not listed in the compiler settings, hence I missed the difference, and visually, well, visually this setting is...  unreadable.

    Anyhow, thanks for asking and suggesting.

**Attention** This is a public forum