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.

Compiler/TMS320C6678: compiler differences version 7.4.24 and 7.6.0

Part Number: TMS320C6678

Tool/software: TI C/C++ Compiler

hi,

i'm getting different disassembly code when compiling with the above versions (when using 7.4.24 version - i get the wanted results). 

it happens only with optimization (-o3).

the following code seems to be the problematic:

void func1(short* as16Tmp1, short* ps16Pnt, short* ps16CoefPnt, short Len)
{
	short i;
	__int40_t i40Temp0;
	for ( i = 0 ; i < Len ; i ++ )
	{
			i40Temp0 = (ps16CoefPnt[i] << 15);
			mIMacDSS__ (i40Temp0, as16Tmp1[15], ps16Pnt[-1-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[14], ps16Pnt[-2-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[13], ps16Pnt[-3-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[12], ps16Pnt[-4-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[11], ps16Pnt[-5-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[10], ps16Pnt[-6-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[9], ps16Pnt[-7-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[8], ps16Pnt[-8-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[7], ps16Pnt[-9-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[6], ps16Pnt[-10-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[5], ps16Pnt[-11-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[4], ps16Pnt[-12-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[3], ps16Pnt[-13-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[2], ps16Pnt[-14-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[1], ps16Pnt[-15-i]);
			mIMacDSS__ (i40Temp0, as16Tmp1[0], ps16Pnt[-16-i]);

			ps16CoefPnt[i] = mSatSD__((i40Temp0 + 0x4000) << 1);
	}

}

mIMacDSS and mSatSD defined as:

#define mIMacDSS__(DOp1, SOp2, SOp3) ((DOp1) += (__int40_t) ((SOp2)*(SOp3)))
#define mSatSD__(DOp1) (_sat(DOp1) >> 16)

additionally, the following compiler flags are used:

-mv6600 --abi=eabi -O3 -g --relaxed_ansi  --quiet --diag_warning=225 --diag_wrap=off --no_bad_aliases --mem_model:data=far -k --obj_directory="Obj" --"../Source/EC/temp_src.c"
'Finished building: ../Source/EC/temp_src.c'

it looks like if i'm compiling with 7.6.0 version the first multiplication (mIMacDSS__) is done with uninitialized register.

BTW, that issue is also relevant to version 8.2.4.

thanks in advance,

shay.