Skip to main content
Visitor II
August 13, 2019
Solved

How to disable all optimization when using COSMIC compiler?

  • August 13, 2019
  • 3 replies
  • 1178 views

Even though I did set optimization to "Disable for Debugging (-no)" there are certen lines of code which are removed by the compiler and are not available for setting a breakpoint and they do not get executed. This can be observed by certin results as well as by the disassembly missing mentioned lines. Is there a way to really disable optimization (including code removal) or at least a list of things that do get optimized even though -no ist used?

    This topic has been closed for replies.
    Best answer by EN20

    Thanks for the idears but I kind of allready found what i was looking for. Sadly there seams to be no such way to turn this and some other parts of the optimization off. For further information have a look here.

    3 replies

    Visitor II
    August 17, 2019

    0690X00000A9oKEQAZ.pngHi

    Is it reproduced for both Debug & Release project settings?

    Visitor II
    August 17, 2019

    Also, the linker may remove from memory space any variable or function which is not called from main() or interrupts.

    Function pointers can make the linker's lost sometime.

    EN20AuthorAnswer
    Visitor II
    August 19, 2019

    Thanks for the idears but I kind of allready found what i was looking for. Sadly there seams to be no such way to turn this and some other parts of the optimization off. For further information have a look here.