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:
Dear TI-Team,
we recently had to update the CGT for C2000 since the version we used was not available on Linux systems. We now use CGT 22.6.1 on Delfino 28346 devices. After upgrading the compiler we ran in some miscalculations.
Having done some investigation I could figure out that an (unsigned)cast is being ignored. I also could make up some minimal example where a similar error occurs:
#include "typedefs.h" int16_t someValue = 0xC0; int16_t someOtherValue = 0xC000; int32_t multiplyUnsignedByGlobalInitial() { int32_t tmp; tmp = someValue; tmp *= (uint16_t)someOtherValue; return tmp; //incorrect: -3145728 } int32_t multiplyUnsignedByLocalInitial() { int16_t someLocalValue = 0xC0; int32_t tmp; tmp = someLocalValue; tmp *= (uint16_t)someOtherValue; return tmp; //correct: 9437184 }
Here are my compiler flags:
--silicon_version=28 --large_memory_model --unified_memory --float_support=fpu32 --opt_level=3 --opt_for_speed=5 --symdebug:dwarf --display_error_number --issue_remarks --asm_listing --diag_warning=225 --keep_asm --quiet --diag_wrap=off
Disabling optimisation (setting opt_level = 1) did not solve neither the initial nor the minimal problem. Can you reproduce the problem?
Best regards,
Christian Kasper
Thank you for notifying us of this problem, and for submitting a concise test case. I can reproduce the same behavior. I filed the entry EXT_EP-11922 to have this investigated. You are welcome to follow it with that link.
Thanks and regards,
-George
To understand why I marked my reply as TI Thinks Resolved, please see the first FAQ in this post.
Thanks and regards,
-George
If it helps: same behaviour occurs with CGT 4.1.4, but not with CGT 5.2.4. I haven't compared the assemblies, though.