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.

Compiler: Compiler Segfaults for template & macro heavy codebase

Tool/software: TI C/C++ Compiler

I have tried compiling my current in-house Firmware for the MSP432 which builds fine with gcc & clang with TI's armcl compiler. Unfortunately the compiler segfaults when compiling the "main" file which requires instantiating a lot of templates and also evaluate a lot of macros.

The compiler is invoked via:

ti/ti-cgt-arm_17.9.0.STS/bin/armcl -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --advice:power=all -g --gcc --define=TARGET_IS_MSP432P4XX --define=ccs --display_error_number --diag_warning=225 --diag_wrap=off --abi=eabi --preproc_with_compile -Iinclude/support_files/CMSIS -Iinclude/support_files -Iti/ti-cgt-arm_17.9.0.STS/include -Iinclude/driverlib/MSP432P4xx -I. devices/FT800_display/main.cpp --output_file=build/FT800_display/main.obj

where the various includes are for driverlib & cmsis headers and "devices/FT800_display/main.cpp" is the C++ main file. I unfortunately cannot share the .pp file publicly that the compiler produces when invoked with --preproc_with_comment as it contains our internal source code.

I suspect that the long lines created by looped macros could be the problem (I have several lines with more than 1000 characters, one of them has even 17k).

  • Dan Cermak said:
    I unfortunately cannot share the .pp file publicly

    I understand.  But without a test case, we have no way to advance the issue.  Are you willing to share it with me privately?  If so, hover your mouse over my screen name or avatar. A box will pop up. Click on Send a private message. In the message compose interface which comes up, use the paper clip icon to attach the preprocessed file. So the file will be accepted, add the file extension .txt to it.

    Thanks and regards,

    -George

  • Thank you for submitting a test case.  I can reproduce the problem.  I filed CODEGEN-4280 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    I discovered that by removing the ULP Advisor option --advice:power=all , it builds clean.  So that's a possible workaround for you.

    Thanks and regards,

    -George

  • Indeed, removing --advice:power=all makes the issue disappear. However, I cannot find the issue in the SDOWP system, has it been fixed already?
  • Dan Cermak said:
    I cannot find the issue in the SDOWP system, has it been fixed already?

    No, it has not been fixed.  When I filed the entry, I neglected to make it public.  I just now changed it.  That change will propagate through the system in a few hours.  Sorry!

    -George