Tool/software: TI C/C++ Compiler
Hi,
I get an internal compiler error while trying to compile the following code:
struct bitfield { bitfield(unsigned = 0) { *((volatile unsigned*)&_raw) = *((volatile unsigned*)&_raw); } operator unsigned() const { return *((volatile unsigned*)&_raw); } unsigned _raw; }; bitfield error_msi_not_acknowledged; void msi_send() { error_msi_not_acknowledged = bitfield(bitfield(0)); }
while using the following command line:
F:/Packages/TI_8.1.0/CodeComposerStudio/ccsv8/tools/compiler/ti-cgt-c6000_8.3.0/bin/cl6x.exe "C:\Users\[...]\Desktop\CompilerError.cpp" -O2
I have not tried version 8.3.1 of the compiler. Workaround for me was to not execute the strange sequence of constructors and cast operators. I have also found that replacing *((volatile unsigned*)&_raw) with ((volatile unsigned&)_raw) no longer produces optimizer crashes, but tends to generate infinite loops when packed into a tight loop where the boundary depends on the cast operator, but maybe my understanding of my the code is lacking there.
Regards,
Lukas