Technical information

Operating Precautions for CPDW9X/NT-CDR-V85X, Y-GHS-MULTI-V800
TM
Customer Notification r20tu0003ed1812 21
No. a10
Wrong debug information are generated involving the peephole optimizer
Version Information
V3.3, V3.5, V4.0.5, V4.0.5c
Details
Using higher optimization options that are involving the peephole optimizer, i.e. -OM, -OS, -OL or
O, causes wrong debug information.
This is a “limitation” of the product. In particular, peephole optimizations which do many things
to improve code quality and to eliminate instructions happens after debug information is emitted.
For Multi 2000 v3.5.1, please refer also to the “Green Hills C/C++ User´s Guide” chapter 6,
“Problems with Source Level Debuggers”.
For Multi 2000 v4.0.5, please refer to the “Building Applications for Embedded V800”, chapter18,
“Problem with source Level Debuggers”.
Example:
The local variable “UC” is not in the register location reported by the debugger. In fact, the local
variable does not really exist, but the debugger information indicates that it does.
unsigned char temp;
void PA(unsigned char a)
{
temp=a;
}
unsigned char PB(void)
{
return (temp+1);
}
unsigned char test (unsigned char UD[4])
{
unsigned char UC;
UC = UD[4];
PA(UC);
UC=PB();
return (UC);
}
int main ()
{
unsigned char B [] = "01234567";
temp = test (B);
return (temp);
}
Workaround
Use option -Onopeep to disable the peephole optimization.