Other Parts Discussed in Thread: C2000-CGT, SYSCONFIG
Tool/software:
Consider a function like the following in debug

where a counter is incremented over a set of enums. The assembly code is more or less what you can expect, after the call the variable is incremented and tested.
(I took screenshots with CCS 20.0.2, but the issue is the same with CCS 12.8.1, in a different and more realistic project)
In fact, after the first run, I find

and that's fine (my enum started at 0, next is 1).
When the loop wraps up I get the surprise

1. variable in memory is 1
2. a MOV has loaded it in AL
3. however, AL is 0 - and this is confirmed running the code
If I continue running the loop it never evaluates to something different, and the called function sees its parameter always at zero.
Note that a few collateral things are making it happen, and it's been a bit hard to replicate it in a short example (I had to add some weird code).
The lines in the example marked with comments //** are the triggers: if you remove/change them, the results are different. As an example, moving line 148 after line 156, the problem disappears, and all runs as expected.
I didn't check it on a different site (PC, programmer, board, etc.). Then I'd like to know if someone can replicate it first, or if it's just something unusual happening to me.
