This is the mail archive of the gcc-bugs@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]

[Bug fortran/24518] Intrinsic MOD incorrect for large arg1/arg2 and slow.



------- Comment #17 from pault at gcc dot gnu dot org  2006-10-31 16:21 -------
The fortran version of Uros' #13:

  real(8) :: x
  real(8) :: t = 0.0
  x = 10000000.0
  do while (x > 0.0)
    t = t + mod (x, 1.7e-8)
    x = x - 1.0
  end do
  print *, t
end

Yields:

$ /irun/bin/gfortran -O2 -march=pentium -mfpmath=387 uros_test.f90

PT169137@PC-THOMAS-P /cygdrive/d/svn/pr24518
$ time ./a
  8.499998368231765E-002

real    0m0.344s
user    0m0.327s
sys     0m0.015s

on a PIV running at 2.5GHz

Changing MOD => MODULO, the user time increases to 0.405s for the
implementation in the second attachment.

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24518


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