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