[PATCH][RFC] Add PAREN_EXPR, make flag_associative_math the default for Fortran

Dominique Dhumieres dominiq@lps.ens.fr
Thu Jan 3 01:34:00 GMT 2008


I have found what's wrong for my test with the patch.
A reduced test case is:

      real function anint4(x, a, b, c)
      real, parameter :: f = 2.0**23
      real x, a, b, c, d, e
      anint4 = x
      a = abs(x)
      if (a < f) then
         anint4 = (f+a) - f
         b = anint4
         c = (anint4 - 0.5) - a
         if (c > 0.0) then
            anint4 = anint4 - 1.0 
         end if
      end if
      end function anint4

If I diff the results of -fdump-tree-optimized with and without
-ffast-math I get:

23c23
<   D.840 = ((__result_anint4)) - D.832;
---
>   D.840 = ((__result_anint4 - 5.0e-1)) - D.832;

Do you understand why -ffast-math eats the '-0.5'?

Dominique



More information about the Fortran mailing list