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: [RFC] fold Reorganization Plan


Joe Buck wrote:-

> > I think it's desirable for front-ends to be able to fold floating
> > point constant expressions too, no?  It can be handy for diagnostics
> > such as detecting overflow or unreachable code based on conditionals
> > whose expression is a floating one, albeit constant.
> 
> The problem is that the user can independently set the IEEE rounding mode.
> This means that you can only fold floating point constants in cases where
> the generated result is exact; you cannot fold 1./3. for example.

As Joseph pointed out, that's what the C99 pragma is for.  For C90 it
is probably best to not fold unless exact or it is necessary.

> Also, you should not assume that the user wants the kinds of diagnostics
> you describe; they might *want* the Infinity or NaN they generated.

You seem to have missed my point.  Nowhere did I say such a thing be
thrown away.  I was talking about diagnostics.  Joseph pointed out
the compiler needs to be able to fold for some initializers anyway.

Whether you can perform the analysis, and how the user can control
the results of that analysis - what you seem to be referring to -
are of course entirely orthogonal.

Neil.


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