[PATCH] Add PAREN_EXPR

Richard Guenther rguenther@suse.de
Wed Feb 20 16:31:00 GMT 2008


On Wed, 20 Feb 2008, FX wrote:

> >  That said - somebody with decent knowledge of the Fortran standard
> >  (and its user community) should decide what to do by default and
> >  what to do with -ffast-math and if Fortran wants an extra flag
> >  that says it wants full IEEE compatibility.
> 
> What will also happen is that, at some point, we will implement the
> IEEE_ Fortran intrinsic modules: loading them in user code (adding a
> "use IEEE_ARITHMETIC" line in the source) acts like a C pragma,
> requiring full IEEE compatibility for a given scope (usually, the
> scope of the function in which this is used). Is that something that
> could be done in the current framework? How hard would it be (speaking
> of middle-end work) to make it possible?

At the moment we can control the involved flags only per compilation
unit.  But for the equivalent C pragma support we at some point need
to add support for this.  The PAREN_EXPR is one step - it can be
generated/omitted where required.  For the other flags we need to
create variant tree codes to indicate whether a operation can
trap, may produce Infs or NaNs or needs to preserve correct signed
zero behavior.  One might also consider to create variant modes
(at the moment we ask if a machine mode supports these kind of stuff),
but then one has to consider what happens for mixed-mode operation.

Dependend on how it is implemented (new tree codes or flags on the
expression), an initial implementation is not too difficult, but
it will be either a lot of work to re-instantiate all valid
optimizations or to audit the code for invalid optimizations.

The granularity can be also questioned - that is, is it enough
to have IEEE_PLUS_EXPR and PLUS_EXPR where the latter has
a behavior controled by flags on a compilation unit scope?

Richard.



More information about the Gcc-patches mailing list