This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? (Was: associative law incombine)
- To: Gabriel Dos_Reis <gdosreis at sophia dot inria dot fr>
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law incombine)
- From: Wolfgang Bangerth <wolfgang dot bangerth at iwr dot uni-heidelberg dot de>
- Date: Wed, 1 Aug 2001 19:08:20 +0200 (MET DST)
- cc: gcc at gcc dot gnu dot org, tim at hollebeek dot com
> 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