What is acceptable for -ffast-math? (Was: associative law incombine)
Wolfgang Bangerth
wolfgang.bangerth@iwr.uni-heidelberg.de
Wed Aug 1 10:08:00 GMT 2001
> The transformations in question aren't documented. So, those having
> "valid reasons to request them" don't even know what there are
> requesting with -fdubious-math.
Well, but then we're talking about a/b/c -> a/(b*c) "and the like", as
a*c+b*c -> (a+b)*c
a*x/a -> x
and probably a whole lot of other things that are equally "dubious".
> But then, if they would have written that form in the first place.
But, as I said, there might be cases where you can't write it in an
optimized way in the first place, such as in
inline double f() { return a/b; }
inline double g() { return c; }
x = f()/g();
plus inlining. You can't just rewrite this into a form that does the
optimized computation without the help of the compiler. However, I'd bet
that for the lower parts of the compiler the resulting stream of commands
look just the same as if it were x=a/b/c right away.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: wolfgang.bangerth@iwr.uni-heidelberg.de
www: http://gaia.iwr.uni-heidelberg.de/~wolf
More information about the Gcc
mailing list