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.

Parents
  • 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...?

Reply
  • 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...?

Children
No data