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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Fixed
    • Medium
    • Resolution: Fixed
    • Code Generation Tools
    • CODEGEN-8100
    • Hide
      C7000_1.4.0.LTS
      C6000_8.3.0
      MSP430_20.2.0.LTS
      ARM_18.12.0.LTS
      MSP430_18.12.0.LTS
      PRU_2.3.0
      ARM_20.2.0.LTS
      C2000_18.12.0.LTS
      C2000_20.2.0.LTS
      Show
      C7000_1.4.0.LTS C6000_8.3.0 MSP430_20.2.0.LTS ARM_18.12.0.LTS MSP430_18.12.0.LTS PRU_2.3.0 ARM_20.2.0.LTS C2000_18.12.0.LTS C2000_20.2.0.LTS
    • Hide
      ARM_18.12.8.LTS*
      C2000_20.2.4.LTS*
      ARM_20.2.4.LTS*
      C7000_1.4.1.LTS
      MSP430_18.12.8.LTS*
      MSP430_20.2.4.LTS*
      C6000_8.3.9*
      PRU_2.3.4*
      C2000_18.12.8.LTS*
      Show
      ARM_18.12.8.LTS* C2000_20.2.4.LTS* ARM_20.2.4.LTS* C7000_1.4.1.LTS MSP430_18.12.8.LTS* MSP430_20.2.4.LTS* C6000_8.3.9* PRU_2.3.4* C2000_18.12.8.LTS*
    • 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));

    Description

      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.

      Attachments

        Activity

          People

            syncuser TI User
            syncuser TI User
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: