Compiler does not account for wraparound when different increment type added to signed int

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-8440
    • Hide
      MSP430_20.12.0.STS
      PRU_2.4.0*
      C2000_20.12.0.STS
      C7000_2.0.0.STS*
      Show
      MSP430_20.12.0.STS PRU_2.4.0* C2000_20.12.0.STS C7000_2.0.0.STS*
    • Hide
      MSP430_21.6.0.LTS
      PRU_2.4.0*
      C2000_21.6.0.LTS
      C7000_2.0.0.STS*
      Show
      MSP430_21.6.0.LTS PRU_2.4.0* C2000_21.6.0.LTS C7000_2.0.0.STS*
    • default
    • Hide
      Cast the subexpression computed with the UL literal to a signed int:

          error += (signed int)(((3686400UL)/8)/(4096));
      Show
      Cast the subexpression computed with the UL literal to a signed int:     error += (signed int)(((3686400UL)/8)/(4096));

      In the case that a larger unsigned increment type was added to a signed int, a compiler optimization did not account for possible wraparound resulting in a negative value and erroneously assumed the signed int variable was never negative.

            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-2695 - Compiler does not account for wrapa...
                SYNCHRONIZED
                • Last Sync Date: