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

Code mapped to __fmin intrinsic drops conditional operand

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-4518
    • Hide
      C2000_16.9.0.LTS
       C2000_18.1.0.LTS
      Show
      C2000_16.9.0.LTS  C2000_18.1.0.LTS
    • Hide
      C2000_16.9.8.LTS
       C2000_18.1.2.LTS
      Show
      C2000_16.9.8.LTS  C2000_18.1.2.LTS
    • No workaround except restructuring the code to avoid this shape.
    • Hide
      A statement like

        if (A >= 0) A = 0;

      is a candidate to be replaced by the __fmin intrinsic, if other details fit. However, the compiler will also accept

        if (A >= 0) B = 0;

      and that is not correct.

      The problem is limited to C2000 with --float_support=fpu32 and when A and B are both floating-point expressions, and applies to both min and max idioms. The incorrect transformation can happen when "A" is an expression as well as when it is just a variable, and the constant value can be any number, not just 0.
      Show
      A statement like   if (A >= 0) A = 0; is a candidate to be replaced by the __fmin intrinsic, if other details fit. However, the compiler will also accept   if (A >= 0) B = 0; and that is not correct. The problem is limited to C2000 with --float_support=fpu32 and when A and B are both floating-point expressions, and applies to both min and max idioms. The incorrect transformation can happen when "A" is an expression as well as when it is just a variable, and the constant value can be any number, not just 0.

      Code mapped to __fmin intrinsic drops conditional operand

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

              Created:
              Updated:
              Resolved: