My code currently has an optimization level of 8. But i'm out of code space and want to change it to level 9. Is there any side effect if we use optimization level 9??
Is there any side effect if we use optimization level 9?
It depends on your code. Code should be written in such a way that the program runs correctly regardless of compiler optimization level. Sadly, this is not always the case. For example, if you use a simple 'for' loop to provide a precise delay, you may find that the delay depends on compiler optimization level (as well as compiler version). Another example would be the use of the keyword 'volatile'. Typically, all variables are treated as volatile at low optimization levels, but an incorrectly written program can break at higher optimization levels because compiler caches non-volatile variables in CPU registers. There can be other examples related to pointer aliasing and so on. So the answer to your question is: it depends on your code.