This adds a middle-end PAREN_EXPR tree code that acts as re-association
barrier for floating point expressions. This allows to model the Fortran
semantics that allow re-association for expressions that are not
explicitly wrapped inside parentheses.
This simple patch (not tested yet) for example preserves a + (b - a)
if you build with -ffast-math.
function testarray (a, b)
implicit none
real*8 :: a, b, testarray
testarray = a + (b - a)
end
eventually this allows expansion of rounding functions on the tree
level (those rely on us preserving stuff like (x + 1e-52) - 1e52 and
not constant fold it).
The way the patch 'works' is that nothing handles (looks through)
PAREN_EXPR at the moment, so it is a conservative implementation. On
the RTL level it just relies on the fact that we do not re-associate
floating point expressions there (we rely on that fact now anyway).
Any thoughts? (Yes, I thought on using a flag on operands or variants
of the associative tree operators, but these either don't work do not
model the semantics close enough)