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 in combine)
- To: dewar at gnat dot com
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: Kevin Handy <kth at srv dot net>
- Date: Mon, 30 Jul 2001 08:31:22 -0600
- CC: gcc at gcc dot gnu dot org
- References: <20010730131401.5EFBCF2B53@nile.gnat.com>
dewar@gnat.com wrote:
>
> Another issue here is that the optimizations in question are unlikely to
> be that significant in practice. In real programs where performance is an
> issue, there will be relatively few opportunities for this kind of
> optimization, and assuming that the program was reasonably competently
> written, those few cases are likely to be just those that should not
> be molested.
>
> Consdier again the assoicative case. The expression
>
> a*b + a*c
>
...
> 2. The somewhat competent programmer, who knows nothing about fpt details,
> but who wants their program to run fast. Such a programmer is likely to
> rewrite this manually as
>
> a +(b*c)
I would hope that a competent programmer would not transform the
expression into this. I would hope he would transform it into
a*(b+c)
instead, unless my algebra has become hopelessly munged since
high school.
> anyway, because that's obviously "faster".