This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -ffast-math and floating point reordering
- From: dewar at gnat dot com (Robert Dewar)
- To: Joe dot Buck at synopsys dot COM, law at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 26 Mar 2004 11:40:32 -0500 (EST)
- Subject: Re: -ffast-math and floating point reordering
> 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).
It's a significant goof for a Fortran compiler not to remember whether
parens are used. GNAT remembers not only if parens were used, but how
many levels, but that's required due to obscure requirements in
conformance rules, and of course it is not passed on to the back end
since (a) that's not necessary, it does not affect semantics in Ada
and in any case (b) there is no way to do that.
> First I'd like to come out in favor of having a flag to turn on FP
> reassociation.
Note that there are two levels here. One is about what the Fortran
standard allows in the absence of parens, which is rearrangement
within an expression. The more extensive permission is to rearrange
over a series of separately computed expressions.