Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-11471

Compiler fails with internal error "Bad kind: TYPE::type_pointed_to"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-11634
    • Hide
      C6000_8.3.0
      MSP430_20.2.0.LTS
      C7000_2.1.0.LTS
      C2000_22.6.1.LTS
      MSP430_21.6.0.LTS
      C2000_21.6.0.LTS
      PRU_2.3.0
      C7000_3.1.0.LTS
      ARM_20.2.0.LTS
      Show
      C6000_8.3.0 MSP430_20.2.0.LTS C7000_2.1.0.LTS C2000_22.6.1.LTS MSP430_21.6.0.LTS C2000_21.6.0.LTS PRU_2.3.0 C7000_3.1.0.LTS ARM_20.2.0.LTS
    • Hide
      MSP430_20.2.8.LTS*
      C7000_2.1.3.LTS*
      MSP430_21.6.2.LTS*
      C7000_3.1.1.LTS
      C2000_22.6.2.LTS*
      C6000_8.3.13
      ARM_20.2.8.LTS*
      PRU_2.3.4*
      C2000_21.6.2.LTS*
      Show
      MSP430_20.2.8.LTS* C7000_2.1.3.LTS* MSP430_21.6.2.LTS* C7000_3.1.1.LTS C2000_22.6.2.LTS* C6000_8.3.13 ARM_20.2.8.LTS* PRU_2.3.4* C2000_21.6.2.LTS*
    • default
    • Hide
      use --opt_level=0 or 1 instead of 2

      See below for instructions on how to set compiler options per file instead of entire project in CCS projects:
      https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-management.html#file-specific-options
      Show
      use --opt_level=0 or 1 instead of 2 See below for instructions on how to set compiler options per file instead of entire project in CCS projects: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-management.html#file-specific-options

      With --opt_level=2, the optimizer generates "internal error" for arrays of pointers similar to below example:
      TP>> internal error: Bad kind: TYPE::type_pointed_to

      void foo(void)

      { char* argv[1]; parse_args(argv); }

      NOTE: earlier fix in CODEGEN-11223 missed a use case that this fix addresses.

      More details:
      ----------------
      The attached file has these lines ...

      static inline __erase_vector __parse_args(uint8_t* ptrInput, uint8_t* argv[])
      {
          /* code here */
      }
      

      Build it ...

      % cl2000 -@options.txt file.c
      "file.c", line 2639: warning #303-D: typedef name has already been declared (with same type)
      "file.c", line 2640: warning #303-D: typedef name has already been declared (with same type)
      "file.c", line 2679: warning #303-D: typedef name has already been declared (with same type)
      TP>> internal error: Bad kind:  TYPE::type_pointed_to
      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
      

      Replace that function with an extern declaration ...

      extern __erase_vector __parse_args(uint8_t* ptrInput, uint8_t* argv[]);
      

      ... and it builds clean.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: