Optimisation Levels 10, 11

Level 10: Rearrange Code;
Level 11: Reuse of Common Exit Code.

Does anyone have any experience of these higher optimisation levels, relying on the LX51 Linker?

This thread reported some bugs, and expressed some misgivings about the advantages:
http://www.keil.com/forum/docs/thread2094.asp

That was v7.02; now we're at v7.07a:

Can anyone confirm that the bugs are really fixed now?

Does it do any better now?

Any other plaudits, Gotchas! or concerns?

Parents
  • I also use optimize-for-size level 11. My results are similar to Mr. Grun's, about a 10% savings on ~60k of code. I have not found any bugs attributable to the optimization.

    The only down side I've experienced is that this level of optimization wreaks havoc on the ability of a source-level debugger to match any given instruction with a line of source code. Any common code the compiler and linker can seek out is ruthlessly replaced with subroutines, so any given line of C is likely to actually call instructions that come from other lines of C. My source-level debugger will jump all over the place when single-stepping instructions. And all the calls to subroutines without meaningful names makes it a bit harder to debug.

Reply
  • I also use optimize-for-size level 11. My results are similar to Mr. Grun's, about a 10% savings on ~60k of code. I have not found any bugs attributable to the optimization.

    The only down side I've experienced is that this level of optimization wreaks havoc on the ability of a source-level debugger to match any given instruction with a line of source code. Any common code the compiler and linker can seek out is ruthlessly replaced with subroutines, so any given line of C is likely to actually call instructions that come from other lines of C. My source-level debugger will jump all over the place when single-stepping instructions. And all the calls to subroutines without meaningful names makes it a bit harder to debug.

Children
More questions in this forum