This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28377S: float compare action wrong when using optimization

Part Number: TMS320F28377S

Tool/software: TI C/C++ Compiler

float A, B;

if(A >= 0)

{

B = 0;

}

the compiler V18.1.1.LTS at opt-register level output as:

MOV32     R0H,@_A
MINF32    R0H,#0 
MOV32     @_B,R0H

if using V6.4.12, I get right result

MOV32     R0H,@_A
CMPF32    R0H,#0
MOVST0    ZF, NF
BF        $C$L1,LT
ZERO      R0H
MOV32     @_B,R0H

$C$L1:

....

  • Thank you for notifying us of this issue.  I can reproduce it.  I filed CODEGEN-4518 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • As I reported in CODEGEN-4517 (now marked as duplicate of CODEGEN-4518), I am having a similar problem on a F28069 using 16.9.7.

    I want to further report that I am using only Optimization level 0 (register optimizations), not 1 or greater as reported by others with a similar problem.

    Since there is no workaround, I had to go back to a compiler version that I know did not have this problem: 6.2.6. This version is way out of date and is missing useful features like being able to see static variables in the debugger.

    Do you know when this problem appeared? I would like to use something newer than 6.2.6. Thanks.

  • The offending code first appeared in 15.12.0. Look for 15.9.0.STS, if it's still available somewhere. Failing that, 6.4.x is a year-and-a-half newer series than 6.2.x, though still old.