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
Hello,
here is my christmas compiler failure for you ;-)
We recently switched from Windows 7 to Windows 10 (finally). One file in our code base then refused to compile correctly in release builds.
Here are the conditions to reproduce the error:
I stripped down the code to a (no longer usefull) minimum which still triggers the failure:
cl2000 -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O2 --opt_for_speed=2 --fp_mode=relaxed -g --c99 --cpp_default --pending_instantiations=0 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=coffabi --aliased_variables --remove_hooks_when_inlining --gen_cross_reference_listing --gen_func_info_listing --section_sizes=on "W:\\MotionControlLibrary\\components\\peripherals\\killer.cpp"
"W:\MotionControlLibrary\components\peripherals\killer.cpp", line 40: warning #552-D: variable "a" was set but never used
INTERNAL ERROR: C:\TI\ccs920\ccs\tools\compiler\ti-cgt-c2000_18.12.4.LTS\bin\opt2000.exe experienced a segmentation fault
while processing function _read_register__26ADT7320_Temperature_SensorFUi file C:\\cygwin64\\tmp\\{623ED5A4-2D7
E-461D-982E-91BFD00AFF0C}
This is caused by a defect in the TI C/C++ Optimizer.
TI Customer Support may be able to suggest a workaround to avoid this.
Upgrading to the newest version of the compiler may fix this problem.
Contact TI in the E2E support forums at http://e2e.ti.com under
"Development Tools", "TI C/C++ Compiler". See the link titled
"Submitting an issue".
We need to see this ENTIRE error message and a complete, reproducible
test case including ALL of the command-line options.
Include the .pp file created by option --preproc_with_comment
The stripped down killer.cpp file is this:
struct CMD_byte
{
CMD_byte(unsigned int address, bool read) :
m_dummy_0(0),
m_register_address(address & 0x07),
m_rw(static_cast<unsigned int>(0)),
m_dummy_1(0)//,
{}
inline // killer!
unsigned int to_uint16_t(void);
unsigned int m_dummy_0 : 3,
m_register_address : 3,
m_rw : 1,
m_dummy_1 : 9;
};
unsigned int CMD_byte::to_uint16_t(void)
{
return ( m_dummy_0
| (m_register_address << 3)
| (m_dummy_1 << 7)
);
}
class ADT7320_Temperature_Sensor
{
private:
void read_register(unsigned int ra);
};
void ADT7320_Temperature_Sensor::read_register(unsigned int ra)
{
CMD_byte cmd(ra, true);
unsigned int a[3];
a[0] = cmd.to_uint16_t();
}
The --preproc_with_comment only version looks exactly the same since no includes or macros are used in the minimum example.
Our workaround for now is to remove the "inline" line marked with "// killer!". But this is rather dissatisfying, we would like to know whats going on.
This is very unexpected and seems rather arbitrary...
Thank you for reporting this problem. You clearly put a lot of effort into cutting down the test case, so thank you again. I can reproduce the same behavior. Even the part where it fails intermittently. I submitted the entry CODEGEN-7011 in the SDOWP system to have this investigated. You are welcome to follow it with the SDOWP link below in my signature.
Thanks and regards,
-George