Hi,
I encountered this multiple times now and think it's time to ask. I use C2000 compiler v6.2.6.
I have assembler functions called by C. The assembler functions are declared in a C header, an example is:
void foo(void *dest, const void *src, unsigned len);
Now under certain unknown circumstances it seems the compiler messes up the function call. As per the calling convention, dest is passed in XAR4, src in XAR5 and len in AL. What happens from time to time is that src is passed in XAR5, but not the address (i. e. the pointer) as expected, but the value pointed to by src: XAR5 is dereferenced and written back to itself before the assembler function is executed...
It happens for example when an array (char[]) is passed as src, but not when a string literal (const char *) is passed.
Am I doing something wrong?
Upgrading to and trying out a latest compiler version would be an option of course, but I would like to know before if this bug is already known and/or fixed from v6.2.6.
Thanks
Felix