Hi
I am working on two projects, one is on F5419, the other one is on FG4618. I am experiencing a interesting problem (bug!?) of the CCE 3.1 optimizer. In F5419 project, my code works OK no matter what optimization level I am using; And on the FG4618 project, in which I am sharing a major portion of the code with F5419 project, the program fails in the USCIA0 TX ISR while using optimization level 2 (default of release build), and the same code works OK while using debug build and optimization level 1.
By inspecting the generated ASM, I noticed that the optimizer extacted a portion of commonly used code to a routine called "abproc0" in almost each ASM file, and normally the the routine is returned with an "RETA" (non ISR code). However, while optimizing the FG4618 USCIA0 TX ISR, the optimizer extracted my buffer management code to a "abproc0" and the routine returns with RETI, I think the RETI caused the code run back to the _c_init00 and restart the software.
In the FG4618 project, the optimizer is doing that because I handled both USCIA0 and USCIB0 TX ISR in the same file, (they are sharing the same IRQ vector), so it can see the duplicated code (inline C++ code in my source), while in the F5419 project, each USCI port is handled in seperate source files, so I don't see the same problem.
My question is, is that really a optimizer bug, or could be something I did wrong? I found the easy work around (optimization level 1), but still curious, and will the CCEv4 potentially fix this?
I also noticed that CCEv4 is released, we purchased CCEv3.1 last spring, how can we get the upgrade?
Many thanks!