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 libfortran/41157] New: dtime not consistent in times reported


The following code was compiled with 
gfortran -g -o test_dtime test_dtime.f

The code is given by (very similar to that given in the info file for gfortran

      program test_dtime
      integer(8) :: i, j, k
      real, dimension(2) :: tarray
      real :: result
      real :: accum
      call dtime(tarray, result)
      print '(''tarray,result:'', 1P, 3E20.11)', tarray, result
      do i=1,100000000          ! Just a delay
        j = i * i - i
      end do
      call dtime(tarray, result)
      print '(''tarray,result:'', 1P, 3E20.11)', tarray, result
      accum = 0.e0    ! Should accumulate 10 times previous tarray(1)
      call dtime(tarray, result)
      do k=1, 10
        do i=1,100000000        ! Just a delay
          j = i * i - i
        end do
        call dtime(tarray, result)
        accum = accum + tarray(1)
      end do
      print '(''accum ='', 1P, E20.11 )', accum
      end program test_dtime

The resulting output is 

tarray,result:   9.99000039883E-04   9.99000039883E-04   1.99800007977E-03
tarray,result:   3.86941999197E-01   0.00000000000E+00   3.86941999197E-01
accum =   1.35349416733E+01

Note that accum should be close to 10 times the value the tarray(1) above, that
is, close to 3.8.  I have no idea where the 13.5... came from.


-- 
           Summary: dtime not consistent in times reported
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fkrogh#gcc at mathalacarte dot com
 GCC build triplet: x86_64-pc-linux-gnu-4.4.1
  GCC host triplet: x86_64-pc-linux-gnu-4.4.1
GCC target triplet: x86_64-pc-linux-gnu-4.4.1


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


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