Tool/software: TI C/C++ Compiler
Hi,
I have a problem with a compiler related issue. I am working with compiler version v6.4.12 which gives different - sometimes not working code - when changing one constant in the code. The setup, where I recognized this problem is described below.
In my rather huge project several matrix times vector multiplications are performed.
The MAC function is defined as follows:
The matrix values are constant:
When I compile the code with the value of MATRIX_S_R_8_10 = 460 it produces working code. However when I change the value to MATRIX_S_R_8_10 = 457 the output of the assembly file looks wrong:
It is difficult to see the connection between the c-code and the assembly file. But when I analyse the lines 1100 - 1102 of the assembly code on the right (MATRIX_S_R_8_10 = 457) I recognize the following:
MOV T,#8131 ; [CPU_] |160|
MPYA P,*+XAR6[1],#457 ; [CPU_] |160|
The register T is loaded with 8131. Afterwards the command MPYA P,loc16,#16bit is executed. Which "loads the T register with the content of the
location pointed to by the “loc16” addressing mode" (SPRU430F). Therefore the value of the T register is overwritten.
Is this a known problem? Does there exist a workaround?
Thanks for your suggestions and comments.
Regards,
Timon
Settings:
DSP: TMS320F28334
Code Composer Studio: 6.1.3.00034
Compiler: v6.4.12
--opt_level: 4
--opt_for_speed: 5