This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/24518] Intrinsic MOD incorrect for large arg1/arg2 and slow.
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Oct 2006 16:21:18 -0000
- Subject: [Bug fortran/24518] Intrinsic MOD incorrect for large arg1/arg2 and slow.
- References: <bug-24518-9236@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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