-ffast-math and floating point reordering
Paul Koning
pkoning@equallogic.com
Thu Mar 25 16:12:00 GMT 2004
>>>>> "Joe" == Joe Buck <Joe.Buck@synopsys.COM> writes:
Joe> ...If -ffast-math is specified, what should we do? One option is
Joe> to use the K&R rule and free-associate at will. I feel
Joe> uncomfortable with that because of the major loss in accuracy
Joe> that can result. If, however, we implement support for the
Joe> Fortran rules, one option would be to relax order of evaluation
Joe> when there are no parentheses (like Fortran), another would be
Joe> to just leave the order the same.
I believe there are also cases where the programmer has good reason to
believe that such transformations should be allowed because the
accuracy properties are appropriate for the application. It would be
good to be able to say so. Perhaps the switch (-ffree-association?)
should be part of -ffast-math, perhaps not. But it would give
non-Fortran programmers a way to get to the optimization opportunities
that Fortran has.
paul
More information about the Gcc
mailing list