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/
    [EMAIL PROTECTED] (personal mail)
    [EMAIL PROTECTED] (CodeSourcery mail)
    [EMAIL PROTECTED] (Bugzilla assignments and CCs)

Reply via email to