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

optimisation settings causing odd behaviour

Hi,

I've recently been experiencing some concern regarding the behaviour of a program, for which the optimiser, when set to favour size [OPTIMIZE (6, SIZE)], occasionally leads to the contents of a global variable getting trashed/overwritten. If the optimisation settings are altered to favour speed, this no longer happens.

It appears not to be an issue with specific XDATA address (where the variable resides), since changing the variables location doesn't prevent this from happening.

The variable in question is only ever modified via a single increment within a timer interrupt function.

Has anyone else experienced anything like this?

IDE: uV2
Compiler: V6.23a
Link/Loc: V4.23

Thanks for any illumination...

David

Parents
  • Jon: I receive no compiler or linker errors or warnings.

    Erik: Please can you explain how "one register set ... will guarantee erratic behaviour."? It will certainly be less efficient, but if the context is saved and restored correctly, the use of a single register set should not introduce a risk of any sort, as I understand it. What am I missing, please?

    Steve Merrick
    Software Designer
    Tribal Data Solutions

Reply
  • Jon: I receive no compiler or linker errors or warnings.

    Erik: Please can you explain how "one register set ... will guarantee erratic behaviour."? It will certainly be less efficient, but if the context is saved and restored correctly, the use of a single register set should not introduce a risk of any sort, as I understand it. What am I missing, please?

    Steve Merrick
    Software Designer
    Tribal Data Solutions

Children
No data