From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Handy To: dewar@gnat.com Cc: gcc@gcc.gnu.org Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine) Date: Mon, 30 Jul 2001 08:30:00 -0000 Message-id: <3B656FBA.948FFBD5@srv.net> References: <20010730131401.5EFBCF2B53@nile.gnat.com> X-SW-Source: 2001-07/msg01939.html 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".