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.
The attached C file causes cl2000 (v22.6.0.LTS) to crash. The same occurs on any optimization level other than "off", and on all versions I tried, going back to at least v18.12.8.LTS.
$ cl2000 -c container_of_crash.c --opt_level=3
>>>> Optimizer terminated abnormally
>>>> in function _foo()
>>>> in file "container_of_crash.c"
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
>> Compilation failure
#define offsetof(type, member) ((unsigned long)&(((type *)0)->member)) #define container_of(ptr, type, member) \ ((type *)((unsigned long)(ptr)-offsetof(type, member))) struct s { int a, b, c; }; int foo(int *pb) { return container_of(pb, struct s, b)->c; }
It seems there's an issue in E2E: when I choose "C2000-CGT" as the affected part number, it forces the question to be in the "Arm-based microcontrollers" forum.
Thank you for notifying us of this problem, and supplying a concise test case. I am able to reproduce the same behavior. I filed EXT_EP-11165 to have this investigated. You are welcome to follow it with that link.
Thanks and regards,
-George