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.
Tool/software: TI C/C++ Compiler
Hi,
i have found a problem on math operations using:
TMS320F28235
TI v18.1.6.LTS compiler (optimization 4/5)
CCS v7.3.0.00019
Let me provide an example code:
long Test1;
int Test2;
......// variable initialization
Test2=15;
Test1 = (Test2*10)/3; // Test1=5 !!!!!!! ERROR!!!
I have test alternative code as:
Test1 = (Test2*100)/30; // Test1=5 !!!!!!! ERROR!!!
Test1 = (Test2*101)/30; // Test1=50 !!!!!!! CORRECT
Test1 = (Test2*10L)/3; // Test1=50 !!!!!!! CORRECT forcing the secon operation to LONG it seems to work correctly.
Test1 = ((Long)Test2*10)/3; // Test1=50 !!!!!!! CORRECT forcing the first operation to LONG it seems to work correctly.
if I split the opration in two step:
Test1 = (Test2*10);
Test1 = Test1/3; // Test1=50 !!!!!!! CORRECT
so I'm not so sure to have understood the math operation issue.
other test .. defining
long Test1;
unsigned int Test2;
.... ......// variable initialization
Test2=15;
Test1 = (Test2*10)/3; // Test1=50 !!!!!!! CORRECT!!!
so what's change beetween the two cases? Test2 defined int or unsigned int..
Please give me support!!
Best Regards
Massimo
Unfortunately, I am unable to reproduce the problem. For the source file with the problem expression, please follow the directions in the article How to Submit a Compiler Test Case. If it not clear which expression has the problem, please add the comment /* PROBLEM HERE */.
Thanks and regards,
-George
Thank you for submitting a test case by private message. I am able to reproduce the problem. I filed the entry EXT_EP-9621 to have this investigated. You are welcome to track it by searching for it at this link.
Thanks and regards,
-George