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.

[DSP CGT] compiler bug with complex structs

Other Parts Discussed in Thread: SYSBIOS

Team,

I am using TI CGT C6000 8.1.0. I m compiling a complex stack that previously compiled fine for ARM (gcc). Now I get internal errors on two files, both issues seem to be related to complex struct defines. The actual instructions at the logged lines are trivial:

e.g.:

    stWriteRsp.ARUUID                = AREP_GET_ARUUID(lpArep);

now the struct fr stWriteRsp is this:

struct _ST_IOD_READ_WRITE
{
  APP_WORD        Seq_Number;
  ST_CLR_RPC_UUID ARUUID;
  ALIGNED_DWORD_DECL(API);
  APP_WORD        Slot_Number;
  APP_WORD        Subslot_Number;
  APP_WORD        Padding;
  APP_WORD        Index;
  ALIGNED_DWORD_DECL(Record_Data_Length);
  union {
    struct {
      APP_BYTE RWPAdding[RW_PADDING_LEN];
    }Wr_Req;

    struct {
      APP_WORD AddData1;
      APP_WORD AddData2;
      APP_BYTE ErrorCode;
      APP_BYTE ErrorDecode;
      APP_BYTE ErrorCode1;
      APP_BYTE ErrorCode2;
    }Wr_Res;

  }RdWr_u;
}STRUCT_ALIGNEMENT;
typedef struct _ST_IOD_READ_WRITE PACK_ALIGNEMENT(ST_IOD_READ_WRITE), APP_FAR * LPST_IOD_READ_WRITE;

followed by the struct for ARUUID:

struct _ST_CLR_RPC_UUID {
  ALIGNED_DWORD_DECL(Data1);             /*4 - 0*/
  APP_WORD   Data2;             /*2 - 4*/
  APP_WORD   Data3;             /*2 - 6*/
  APP_BYTE   Data4[UUID4LEN];   /*8 - 8*/
}STRUCT_ALIGNEMENT;             /*   16*/
typedef struct _ST_CLR_RPC_UUID PACK_ALIGNEMENT(ST_CLR_RPC_UUID), APP_FAR* LPST_CLR_RPC_UUID;

As you can see it won't be trivial to reproduce without providing full sources... however this is a 3P stack with a lot of dependencies to our IA-SDK...

Unfortunately the issue is time critical as we need to deliver a project based on this to a large customer by end of the week!

Is there a compiler expert that would walk with me through the code by webex to find a workaround? I know that is a stretch but I don't know what else to do here. Any tips welcome...

Best regards,

Frank

Here is the log:

**** Build of configuration Debug for project Nimu_ICSS_idkAM572x_c66x ****

"C:\\TI\\ccs613\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc/frmgendv.c'
'Invoking: C6000 Compiler'
"C:/TI/ccs613/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/bin/cl6x" -mv6600 --include_path="C:/TI/ccs613/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/protocols/snmp/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/src/addin/mrp/mrc_only" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/include/mrp" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/pndeviceSysBios" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/src/addin/mrp" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/protocols/profinet_slave/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/include/os_SYSBIOS" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/include/RT_MRP" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x" -g --define=SOC_AM572x --define=AM57XX_FAMILY_BUILD --define=IDK_AM572X --define=USE_BIOS --define=C66X --define=NSS_GEN2 --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_wrap=off --diag_suppress=1111 --diag_suppress=827 --diag_suppress=824 --diag_suppress=837 --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77 --diag_suppress=232 --display_error_number --preproc_with_compile --preproc_dependency="third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc/frmgendv.d" --obj_directory="third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc" --cmd_file="configPkg/compiler.opt" "../third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc/frmgendv.c"

>> Compilation failure
third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc/subdir_rules.mk:21: recipe for target 'third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc/frmgendv.obj' failed
"C:\TI\industrial-automation-lab\Projects\PN_AM57x_DSP\NimuICSS_idkAM572x_c66x\third_party\protocols\profinet_slave\IO-Device\src\addin\mrp\mrp_datatypes.h", line 47: warning #303-D: typedef name has already been declared (with same type)
>> ../third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc/frmgendv.c, line 426:
               INTERNAL ERROR: Decomposition error


This may be a serious problem.  Please contact customer support with a
description of this problem and a sample of the source files that caused this
INTERNAL ERROR message to appear.

Cannot continue compilation - ABORTING!

gmake: *** [third_party/protocols/profinet_slave/IO-Device/src/toolkit/msg_acyc/frmgendv.obj] Error 1
'Building file: ../third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl/plugsm.c'
'Invoking: C6000 Compiler'
"C:/TI/ccs613/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/bin/cl6x" -mv6600 --include_path="C:/TI/ccs613/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/protocols/snmp/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/src/addin/mrp/mrc_only" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/include/mrp" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/pndeviceSysBios" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/src/addin/mrp" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/protocols/profinet_slave/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/include/os_SYSBIOS" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/include/RT_MRP" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x/third_party/protocols/profinet_slave/IO-Device/include" --include_path="C:/TI/industrial-automation-lab/Projects/PN_AM57x_DSP/NimuICSS_idkAM572x_c66x" -g --define=SOC_AM572x --define=AM57XX_FAMILY_BUILD --define=IDK_AM572X --define=USE_BIOS --define=C66X --define=NSS_GEN2 --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_wrap=off --diag_suppress=1111 --diag_suppress=827 --diag_suppress=824 --diag_suppress=837 --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77 --diag_suppress=232 --display_error_number --preproc_with_compile --preproc_dependency="third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl/plugsm.d" --obj_directory="third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl" --cmd_file="configPkg/compiler.opt" "../third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl/plugsm.c"

>> Compilation failure
third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl/subdir_rules.mk:14: recipe for target 'third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl/plugsm.obj' failed
"C:\TI\industrial-automation-lab\Projects\PN_AM57x_DSP\NimuICSS_idkAM572x_c66x\third_party\protocols\profinet_slave\IO-Device\src\addin\mrp\mrp_datatypes.h", line 47: warning #303-D: typedef name has already been declared (with same type)
>> ../third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl/plugsm.c, line 296:
               INTERNAL ERROR: Decomposition error


This may be a serious problem.  Please contact customer support with a
description of this problem and a sample of the source files that caused this
INTERNAL ERROR message to appear.

Cannot continue compilation - ABORTING!

gmake: *** [third_party/protocols/profinet_slave/IO-Device/src/toolkit/sttup/aseimpl/plugsm.obj] Error 1
gmake: Target 'all' not remade because of errors.

  • Don't let this ...

    Frank Walzer said:
    As you can see it won't be trivial to reproduce without providing full sources... however this is a 3P stack with a lot of dependencies to our IA-SDK...

    ... worry you.  We have dealt with similar situations many times.  The source files frmgendv.c and plugsm.c fail to build.  Both of them incur this ...

    Frank Walzer said:
    INTERNAL ERROR: Decomposition error

    Please preprocess those files and attach to your next post.  I can use that to reproduce the problem.  I will file an issue against the compiler.  I will attempt to find a workaround.

    Thanks and regards,

    -George

  • A quick thing to try: make sure that all of the structs have tags.  That is:

     union RdWr_u_tag {
        struct Wr_Reg_tag {
          APP_BYTE RWPAdding[RW_PADDING_LEN];
        }Wr_Req;
    
        struct Wr_Res_tag {
          ...
        }Wr_Res;
        ...
        } RdWr_u;
    
  • I tried to play with the tags but didn't help.
    Both issues seem to have only

    ST_CLR_RPC_UUID ARUUID;

    in common. So I suspect this structure. There is some packed attribute that may a role..
    I will follow George's advice..

    regards,
  • George,
    thanks. Great wiki page...

    Now I followed this for both files (original headers without the mentioned trials on adding tags).
    As this is an external forum I am going to send you the files by e-mail as they still contain 3P IP. Hope that is ok.

    Regards,
  • Thank you for sending the in the files.  I can reproduce the problem.  I filed CODEGEN-1333 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    The only workaround I found is to change the structure assignment to a memcpy.  That works.  But it looks to be impractical.  There are many such assignments.  I will ask the development team to analyze this bug just enough to suggest a practical workaround.  That said, there may not be a practical workaround.

    Thanks and regards,

    -George