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


On Tue, 15 Feb 2005, Joe Buck wrote:

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

You can fold 1./3. unless the user uses the FENV_ACCESS pragma to say you 
can't in a particular region of the code.  (Or -frounding-math while we 
don't have FENV_ACCESS, although -frounding-math may not work fully either 
as parts of the compiler may not be aware that the results of apparently 
identical floating-point computations may depend on the rounding mode.)

Even with FENV_ACCESS, for C you still need to fold 1./3. in static 
initializers (using the default rounding mode in that case).

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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