I warn anybody before using ARM Keil 4.13a. It generates defective code. I have spent several hours with debugging a code that has been already worked. The problem affects local variables of functions and passing arguments. Code has been wrongly compiled without any optimization. I have no courage and time to test optimizations.
I also encourage Keil not to publish Keil 4.13a any more.
Keil 4.12 seems to be OK.
Once it got to the correct case, the code then passed this local variable into another function. On single stepping we found that the compiler was using r9 during the switch statement to determine which case was a match.
when a switch "got to the correct case" what does it matter what happene to the value switched on
Erik
Hi,
[Copy-pasting from my reply above, which was a reply direct to the OP]
After email communication with Jaroslav, we (he and I) have come to the conclusion that this is not a compiler bug.
The debugger appears to be reporting erroneous values, and when hard printf()s were added to print the values they appeared correct. This would indicate that the problem is likely to be elsewhere.
From RVCT's point of view there does not appear to be a code generation problem.
Kind regards,
James Molloy Graduate compiler engineer, RVCT, ARM.
"...there does not appear to be a code generation problem."
Thanks for the info.
Good.
But there do appear to be debugger issues?
Are these related to the debugger issues that Tamir mentioned?
Can you give an indication of where the debugger can be trusted, and where it can't?
Hi Andy,
This would be a question for Keil.
Thanks,
James
the issue Tamir reported was related to the debugger. If you also facing an issue please create a small test project which shows the problem and send it to Keil Support (support.intl@keil.com). I will take a look and provide a patch if required.
Best regards, Alexander Zaech Senior Support Engineer Keil - Tools by ARM
Sorry - I got the impression you were from Keil!