This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Code size variation between C51 Compiler Versions

I have some code that compiles under C51 compiler V7.05 and uses 0E5AH of code space. The same code compiles under C51 compiler V8.06 and uses 107AH of code space. Why the increase in code space?

I am using the eval. version and working on Silabs F330 uP.

  • What is your optimization setting for both projects? Have "Favor size" selected in either?

  • beware of defaults.

    I once got caught in a "works with this version, lots of errors with another" and neither Keil support nor this forum caught the fact that my problem was due to a change of defaults between two versions untill I reposted the third time in 6 months.

    Try running both versions with everything specified nothing defaulted (optimixation, model, ....)

    Erik

  • Remember no: no HLL compiler ever gives you any guarantees about the precise machine instructions that will be generated - it should be pretty much assumed that different compiler versions will give different results.

    This is the fundamental reason why timing loops are a no-no in 'C' (or any other HLL).

    However, having said that, one would generally hope that the code size generated by a new compiler version would be no worse than its predecessor!

    As Erik says, have you checked that all the settings are equivalent - defaults may certainly change between versions!

    Maybe some Libraries have changed?

    You'd need to inspect the LST and MAP files to see exactly where the extra is coming from.

    You might just be unlucky - maybe something has changed that generally gives tighter code, but yours is the exception...?