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

Compiler fails to optimize out short lived variables, which causes loop to run slower

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Low Low

      The attached source file contains an implementation of convolution of integer values. It has one loop that makes 4 calls to an inlined function. Build it with version 7.4.24 ...

      % cl6x -@options.txt file.c
      

      Inspect the resulting assembly code, and see the loop gets II=4. Build it again with 8.3.12, and the loop gets II=7.

      Somehow, version 7.4.24 optimizes out some short-lived variables in the inlined function. They do not appear in the optimizer generated comments. But 8.3.12 has them. That generates more MV and ADD instructions in the loop, driving up the resource bound.

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

              Created:
              Updated: