Tuesday, May 22, 2012

Why is -freciprocal-math unsafe in GCC?

-freciprocal-math in GCC changes the following code
double a = b / c;
to
double tmp = 1/c;
double a = b * tmp;



In GCC manual, it's said that such an optimization is unsafe and is not sticked to IEEE standards. But I cannot think of an example. Could you give an example about this? Thank you.





No comments:

Post a Comment