switch statement case with unsigned short C++ scoped enum is incorrect

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-13376
    • Hide
      C7000_6.0.0.STS
      C6000_8.5.0.LTS
      MSP430_21.6.0.LTS
      C6000_8.3.13
      MSP430_20.2
      C7000_4.1.0.LTS
      Show
      C7000_6.0.0.STS C6000_8.5.0.LTS MSP430_21.6.0.LTS C6000_8.3.13 MSP430_20.2 C7000_4.1.0.LTS
    • Hide
      C7000_5.0.1.LTS*
      MSP430_20.2.8.LTS*
      MSP430_21.6.2.LTS*
      C7000_4.1.2.LTS*
      C6000_8.3.14
      Show
      C7000_5.0.1.LTS* MSP430_20.2.8.LTS* MSP430_21.6.2.LTS* C7000_4.1.2.LTS* C6000_8.3.14
    • default
    • Change the enum to a C enum instead of a C++11 scoped enum, or change the switch statement to a tree of if statements.

      If the user's code has a switch statement with a controlling expression which is a C++11 scoped enum type with an unsigned underlying type smaller than int, and any of the values of the scoped enum have the high bit set, the compiler may produce incorrect code for the switch statement.

      It is possible for this bug to occur at any level of optimization, but it is more likely to occur when the optimizer is not used (-Ooff).

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

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-5118 - switch statement case with unsigned...
                SYNCHRONIZED
                • Last Sync Date: