Compiler crashes on switch statement with hundreds of thousands of case labels

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • Code Generation Tools
    • CODEGEN-11322
    • Hide
      C2000_22.6.0.LTS
      C2000_25.11.0.LTS
      Show
      C2000_22.6.0.LTS C2000_25.11.0.LTS
    • default
    • Rewrite the switch to use if/then statements checking the range of the input.
    • Hide
      The compiler has trouble handling switch statements with a very large number of case labels. Using the GNU-like extension of case label ranges is an easy way to create a very large number of case labels, which can quickly overflow the compiler's call frame stack.
      Show
      The compiler has trouble handling switch statements with a very large number of case labels. Using the GNU-like extension of case label ranges is an easy way to create a very large number of case labels, which can quickly overflow the compiler's call frame stack.

      The attached source file contains switch case ranges such as ...

      	case RAMLS0_BASE_ADDR ... RAMD1_LAST_ADDR:
      	f1();
      	break;
      

      Build it ...

      $ cl2000 file.c
      
      >> Compilation failure
      

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

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-4112 - Compiler crashes on switch statemen...
                SYNCHRONIZED
                • Last Sync Date: