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.

CLA Source Does Not Compile with Optimisations Off

Other Parts Discussed in Thread: C2000WARE

Hello,

I have a mixed .c and .cla program for F2837xD. Usually I have global compiler (Version: 11.1.0.00011) optimisation set to level 3.

I have just created a DEBUG build where the only difference is that global optimisation is set to level 0 (off). In this case the compiler does not compile the .cla file but it does not give me any clue as to why.

Building file: "../cla_tasks.cla"
Invoking: C2000 Compiler
"C:/ti/ccs1110/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --opt_for_speed=5 --fp_mode=relaxed --include_path

>> Compilation failure
subdir_rules.mk:35: recipe for target 'cla_tasks.obj' failed
gmake: *** [cla_tasks.obj] Error 1

Changing -Off to -O3 in above arguments succeeds in compile and then link.

The manual section "10.1 How to Invoke the CLA Compiler" does not mention any issue in this respect. In any case, the compiler should give some indication why the file fails to compile.

Thank you.

  • Hello,

    WOuld it be possible to provide a test case? I would need a the project + source files. I don't necessarily need the complete project, just something stripped down is fine as long as it can reproduce the issue. It doesn't even need to be a complete project (doesn't have the build successfully). I just need to reproduce the situation where the .cla file builds when optimization is enabled and it fails when optimization is off.

    Thanks

    ki

  • Thanks Ki.

    I narrowed down the issue to a particular inline function and it looks like that it's the function name length rather than its contents triggering the problem.

    I made a test case source file (attached) including the problematic function name. This file does not compile when optimisations are off. Hopefully you will see the same.

    foo() does not trigger the issue.

    CLLLC_calculatePWMDutyPeriodPhaseShiftTicks_primToSecPowerFlow() does trigger the issue.

    Before anyone thinks I'm nuts naming a function like this, it's from a TI reference design!

    P.S. I can't seem to attach cla_tasks.cla but I can attached cla_tasks.zip. Is that intentional?

    cla_tasks.zip

  • Thank you for the test case. I can reprdouce the issue like you entioned.

    I get a seg fault:

    ---

    Building file: "../cla_tasks.cla"
    Invoking: C2000 Compiler
    "C:/ti/ccs1110/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --opt_for_speed=2 --fp_mode=relaxed --include_path="C:/ti/workspaces/1110/cla_ex1_asin" --include_path="C:/ti/workspaces/1110/cla_ex1_asin/device" --include_path="C:/ti/C2000Ware_4_00_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/ccs1110/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_suppress=10068 --diag_suppress=770 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="cla_tasks.d_raw" --include_path="C:/ti/workspaces/1110/cla_ex1_asin/CPU1_RAM/syscfg" "../cla_tasks.cla"

    >> Compilation failure
    subdir_rules.mk:23: recipe for target 'cla_tasks.obj' failed
    "C:/ti/C2000Ware_4_00_00_00/driverlib/f2837xd/driverlib/adc.h", line 1850: warning #173-D: invalid type conversion
    "C:/ti/C2000Ware_4_00_00_00/driverlib/f2837xd/driverlib/adc.h", line 1851: warning #173-D: invalid type conversion
    "C:/ti/C2000Ware_4_00_00_00/driverlib/f2837xd/driverlib/adc.h", line 1904: warning #173-D: invalid type conversion
    "C:/ti/C2000Ware_4_00_00_00/driverlib/f2837xd/driverlib/adc.h", line 1905: warning #173-D: invalid type conversion
    "../cla_tasks.cla", line 15: warning #552-D: variable "temp" was set but never used
    "../cla_tasks.cla", line 24: warning #552-D: variable "temp" was set but never used

    INTERNAL ERROR: C:\ti\ccs1110\ccs\tools\compiler\ti-cgt-c2000_21.6.0.LTS\bin\cgcla.exe experienced a segmentation fault
    while processing function CLLLC_calculatePWMDutyPeriodPhaseShiftTicks_primToSecPowerFlow

    This is caused by a defect in the TI G3 C/C++ Codegen.
    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 issue occurs just like you said - when optimization is enabled. And just for that specific function.

    I will bring this thread to the attention of our compiler exptert.

    Thanks

    ki

  • Thank you for notifying us of this problem, and supplying a test case.  I can reproduce the same result.  I filed the issue EXT_EP-10749 to have this investigated. You are welcome to follow it with that link.

    Thanks and regards,

    -George

  • Thanks Ki and George. Just one last question: Your compiler output told you which symbol was causing the error...

    while processing function CLLLC_calculatePWMDutyPeriodPhaseShiftTicks_primToSecPowerFlow

    ...but I had to work it out by trial and error. How do I get the same compiler error output information as you please?

  • For some reason, when you build it, the long INTERNAL ERROR diagnostic is not emitted.  When Ki or I build it, we see that diagnostic.  It is the diagnostic which names the problem function.  Once the bug is characterized, we may be able to explain why the diagnostic is not always emitted.

    Thanks and regards,

    -George