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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-11223
    • Show
      https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1238750/tms320f28388d-optimization-problems-compiler
    • Hide
      C2000_22.6.0.LTS
      C6000_8.3.0
      MSP430_20.2.0.LTS
      C7000_2.1.0.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
      C2000_22.6.0.LTS C6000_8.3.0 MSP430_20.2.0.LTS C7000_2.1.0.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.1.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.1.LTS C6000_8.3.13 ARM_20.2.8.LTS* PRU_2.3.4* C2000_21.6.2.LTS*
    • default
    • use --opt_level=0 or 1 instead of 2

      NOTE: CODEGEN-11634 addresses another use case that below fix did not.

      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); }

      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: