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

Optimization level not working

Hi , I am working on LPC1788 with RTX , my code size is much bigger , so i want to optimize my code, after sarching through internet , there is optimization level(-O1 to -O3) specified by keil , but when i am using that optimization level(tried each level)in my code,but it is not working , not in debug mode also , why is this happened , please help or suggest.

Parents
  • >>but my code is finely working without optimization

    Yes it might appear to, but I'm willing to believe there is a latent issue with your code over a bug in the compiler. The optimizer will not be tolerant of sloppy coding practices.

    The compiler outputs "errors" where there are issues with syntax, it does not make a judgement about functional correctness.

    >> i just want to apply optimization level
    Ok, then you might need to apply function level attributes or pragmas to control optimization, until you identify the code at issue. Use bisection to isolate the issue.

Reply
  • >>but my code is finely working without optimization

    Yes it might appear to, but I'm willing to believe there is a latent issue with your code over a bug in the compiler. The optimizer will not be tolerant of sloppy coding practices.

    The compiler outputs "errors" where there are issues with syntax, it does not make a judgement about functional correctness.

    >> i just want to apply optimization level
    Ok, then you might need to apply function level attributes or pragmas to control optimization, until you identify the code at issue. Use bisection to isolate the issue.

Children