This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

accessing pointed values and increasing pointer, get different results in Visual Studio and CCS3/CCS5



Hello,
I meet a problem when debugging below code:

/////////////////////////////////////////////////////////////////////

 unsigned int sigmaM,sigmaM2;

 DSP8u *pTempTpl = (DSP8u *)malloc(64);

 sigmaM=0;
 sigmaM2=0;

 *(pTempTpl+0) = 90;
 *(pTempTpl+1) = 80;

 sigmaM += *pTempTpl; /* pos1 */
 sigmaM2 += (*pTempTpl) * (*pTempTpl++);

 // /* pos2 */

/////////////////////////////////////////////////////////////////////

I got different results when running above code in Visual Studio 2008 and CCS3/CCS5:
(1) when stopping at pos1
I see:
 *(pTempTpl+0) = 90;
 *(pTempTpl+1) = 80;
which is as expected both in VS2008 and CCS.
(2) when stopping at pos2
(a) in VS2008
sigmaM value is 90,
sigmaM2 value is 8100 as expected
(b) in CCS C6000 pjt
sigmaM value is 90,
sigmaM2 value is 7200, not as expected

what's the reason?
thanks!