This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -ffast-math and floating point reordering


In message <20040324170719.A12420@synopsys.com>, Joe Buck writes:
 >If -ffast-math is not specified, we should follow the language standards.
 >First question: can tree-ssa distinguish, for Fortran, whether parentheses
 >were present and so whether reordering is allowed?
No.  The front-ends don't pass enough information around in the tree nodes
to know when such changes are safe/unsafe.  Even if the information existed
none of the optimizers would know how to use it (at least initially).


 >If -ffast-math is specified, what should we do?  One option is to use the
 >K&R rule and free-associate at will.  I feel uncomfortable with that
 >because of the major loss in accuracy that can result.  If, however, we
 >implement support for the Fortran rules, one option would be to relax
 >order of evaluation when there are no parentheses (like Fortran), another
 >would be to just leave the order the same.
First I'd like to come out in favor of having a flag to turn on FP
reassociation.

The question then becomes whether or not -ffast-math ought to turn that
flag on.  I'm neither a significant user or expert in FP arithmetic.  So
I've got no strong opinions here.


jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]