Compiler may generate invalid assembly for load or store instruction in a loop

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-16050
    • Hide
      C7000_6.0.0.STS
      C7000_5.0.0.LTS
      C7000_6.2.0.LTS
      C7000_6.1.0.STS
      Show
      C7000_6.0.0.STS C7000_5.0.0.LTS C7000_6.2.0.LTS C7000_6.1.0.STS
    • C7000_6.2.0.LTS
    • default

      Compiler may generate invalid assembly for load or store instruction in loop with a missing functional unit.

      So far we have only seen this occur when accessing/changing function parameters in a loop in a variable-argument function. But in theory it may occur in other places.

      If/When this bug occurs, the compiler will "successfully" produce assembly, but the assembler will throw an error "Invalid Instruction".

      Below is snippets of some example code that causes the problem.

      int my_sscanf(const char *s, char *f, ...)
      {
        va_list ap;
      
        int nvars = ...;
      
        ...
      
        va_start(ap, f);
      
        while (*f)
        {
            ...
      
            while (!(*s == 0 || !isspace(*s)))
            {
                s++;
            }
      
            switch (*f)
            {
                case '%':
                {
                    ...
                    break;
                }
            }
        }
      
        va_end(ap);
      
        return nvars;
      }
      

      When this code is compiled you may get an error like this:

      "/tmp/TIL6IowOqQr", ERROR!   at line 454: [E0003] Invalid instruction
      	   [ A1]   STD             B0,*SP(304)       ; [] |35| 
      
      "/tmp/TIL6IowOqQr", REMARK   at line 454: [R0001] After symbol substitution the
                                                        line became:
      	   [ A1]   STD             B0,*D15(304)       ; [] |35| 
      
      1 Assembly Error, No Assembly Warnings
      
      Errors in Source - Assembler Aborted
      
      >> Compilation failure
      

      You can know if your code is affected by this bug by whether it fails to build. If the compiler succeeds to make an object file with your code, your code is not affected by this bug. 

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-6969 - Compiler may generate invalid assem...
                SYNCHRONIZED
                • Last Sync Date: