This has the advantage over volatile perhaps in that it will not block optimisations when you do enable them. Then the later assignment to zero will require explicit code. To avoid this in the code, rather than switching it off globally, you could initialise val to a non-zero value in this case: int val = -1 It is unusual perhaps, but it appears that this compiler optimises by default, and distinguishes between compiler optimisations and assembler optimisations (performed as the compilation stage), and them makes you switch off each individual optimisation separately. ![]() It can hook into Cosmic or Raisonance STM8 compilers, and provides project management, a text editor, and integrated debugging. STVD ST Visual Develop is the official (and free) IDE for the STM8 microcontroller. It seems that it is this constant propagation feature that you must explicitly disable. The STM8 manages these trade-offs in an efficient manner. Itself until the variable is modified or a flow break isĮncountered (function call, loop, label. ![]() When a variable is assigned with a constant, any subsequent access to that variable is replaced by the constant It seems possible that the code generator stage that runs before assembly optimisation may perform higher level optimisation such as redundant code removal.ĭisable the constant propagation optimization. It is not clear from the manual, but it seems that the -no option prevents assembly level optimisation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |