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.

F2837xS CGT 6.4.2 errors

Hi,

I'm working on a F2837xS platform using CGT 6.2.11 with optim level 4. I just switched to CGT 6.4.2 and I have compile errors I've never seen. Here's what I see in the console  :

----------------

"interrupt.c"
' '
"C:\Users\STHERR~1\AppData\Local\Temp\1399210", ERROR! at line 1837: [E0004] Not expecting indirect operand - Operand 1
TEST *--XAR4 ; [CPU_] |471|

1 Assembly Error, No Assembly Warnings
Errors in Source - Assembler Aborted

>> Compilation failure
gmake: *** [CANDriver.obj] Error 1

------------------

Has anyone seen this?

If I remove some files, I can make it work but that doesn't help much.

Regards,

  • It appears the compiler is generating assembly code the assembler rejects.  This should never happen.  Please preprocess the relevant C source file and attach it to your next post.  Also show the exact compiler options used.  

    Thanks and regards,

    -George

  • The TEST instruction does not allow any argument but "ACC." I assume from the format of the instruction that this is compiler-generated code. In that case, this is certainly a bug in the compiler.
  • Hi,

    Here is my file. I also downloaded the new 6.4.3 hoping it could solve my problem. Sadly not... The compiler command line is : 

    "c:\\ti\\ccsv6\\utils\\bin\\gmake" -k -j 8 Common/platforms/F2837xS/drivers/CANDriver.obj
    'Building file: D:/Common/platforms/F2837xS/drivers/CANDriver.cpp'
    'Invoking: C2000 Compiler'
    "c:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.3/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O4 --opt_for_speed=0 --include_path="D:/Sources/" --include_path="c:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.3/include" --include_path="D:/Common/" --include_path="D:/Common/3rdparty/TI/F2837xS_headers/include" --include_path="D:/Common/3rdparty/TI/F2837xS_common/include" --include_path="D:/Common/3rdparty/TI/F2837xS_common/inc" --include_path="D:/Common/3rdparty/TI/F2837xS_common/" --include_path="D:/Common/3rdparty/TI/F2837xS_common/driverlib" --advice:performance=all --relaxed_ansi --cpp_default --preproc_only --preproc_with_compile --define=CPU1 --define=CPU_C2800 --define=F2837xS --define=_FLASH --diag_warning=225 --display_error_number --diag_wrap=off --obj_directory="Common/platforms/F2837xS/drivers" "D:/Common/platforms/F2837xS/drivers/CANDriver.cpp"
    "C:\Users\STHERR~1\AppData\Local\Temp\1464012", ERROR! at line 1791: [E0004] Not expecting indirect operand - Operand 1
    TEST *--XAR4 ; [CPU_] |470|


    Errors in Source - Assembler Aborted
    1 Assembly Error, No Assembly Warnings

    If I'm missing something, just let me know. The pp source file is supposed to be attached with my post.

    Regards,

    CANDriver.zip

  • Thank you for submitting a test case.  I can reproduce the same error.  I filed SDSCM00051625 in the SDOWP system to have this investigated.  Feel free to follow it with the SDOWP link below in my signature.

    One workaround is to change the optimization level option from -O4 to -O1.

    Thanks and regards,

    -George

  • Here is another workaround to consider.  Build with -s to save the assembly source file and have compiler generated comments added to it.  Inspect that file to see which function causes the error.  Add #pragma FUNCTION_OPTIONS("-O1") just before that function.  Thus only that function is optimized at level 1.  The rest of the file still builds with optimization level -O4.  In this specific case it looks like ...

    #pragma FUNCTION_OPTIONS("-O1")
    eCanDriverStatus::Type CANDriver::RegisterMailbox(uint16_t &outMailboxHandle, const eCanMailboxPriority::Type priority, void *associatedFifo)
    

    Note to others reading this thread ... That #pragma syntax is correct only for C++.  For C, you have to write #pragma FUNCTION_OPTIONS(name_of_function, "-O1")

    Thanks and regards,

    -George

  • Hi George,

    Thank you very much for the info. When I reduce the optimization level, I knew the assembly problem was going away but new ones got in. I thought I could get over them but, I can't get it to compile now.

    So, I put optim level 1 on the specific method and now it compiles as is I set optim level to the complete program. The problem is that I get unresolved symbol on 2 TI methods : CANIntRegister (can.c) and IntRegister (interrupts.c). I don't have those errors if I compile with 6.2.11. 

    I'm still trying to figure out a way to make it work. If you have any ideas, it would be appreciated.

    Regards,