Hi, all:
Our platform is MPC5604 chip. We use codewarrior IDE(Version is "5.9.0") to build our project. In build process, we found a problem.
1. Problem description
The code is shown below:


Fig.1 operating result
In the code, variable named "local_A" is always equal to 1, the PC pointer can't jump into the branch.
But actually the judgement condition is false, the PC pointer is still jump into the branch. you can see the result in Fig.1.
2. Problem analysis
We analysis the assemble code and found no error with the code. so we analysis the build options.
at last, we found there is a parameter can lead to this problem. The parameter is "Global Optimization Settings".


Fig.2 Faster build option
If this Global Optimization Settings is set as Fig.2 or optimization level is less than 4, the problem will reappear.


Fig.3 smaller code size build option
Only this Global Optimization Settings is set as Fig.3. The problem will never happen.
3. Question
1)we don't know the mechanism. If we configure the optimization setting as Level4, does it lead other new problems?
2) why other levels lead this problem?
Thank you for your reply.