-ffast-math and floating point reordering

Robert Dewar dewar@gnat.com
Fri Mar 26 18:33:00 GMT 2004


> 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.



More information about the Gcc mailing list