Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Else Path sets an Overflow Bit, without calling it...

$
0
0

(Please visit the site to view this file)Hi Team,

i've obseve following issue on the C674x.

an issue occurs in this part of code:

------------------------------------------------- 

float flIn = gflValue;

  if (flIn >= gflMax)
  {            

    gintValue = INT_MAX;     

  }
  else if (flIn <= gflMin)
  {  
    gintValue = INT_MIN;    

  }
  else
  {  

    gintValue = (int) flIn;   
  } 

-----------------------------------------------------

at optimization level 3, if i step through i see that the code execution always jumps to the "else" clause even if it is not required.

The statement in theelse clause leadstoalarge negative value which sets theoverflowbits in  FADCR, FAUCR, FMCR registers. 

I've attached the CCS project (her you should see that before "else if" clause, which should be executed, the code in the "else" clause is exexuted first and then "else if" clause)

First i thought that this is an copiler issue, but the simulation doesn't show the error, only the real device, here is the post from the compiler forum:

https://e2e.ti.com/support/development_tools/compiler/int-compiler/f/85/p/281248/987809.aspx

The compileriscalled as follows:

cl6x -c -O3 -ms2 -al -ps -pdse=255 -mv6700 --mem_model:data=far -mi200 TestCode.c

Thanks and regards,

Oleg

 

 

 


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>