public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/62049] New: Negative count_rate when calling system_clock
@ 2014-08-07 11:09 wxcvbn789456123-nw6wda at yahoo dot fr
  2014-08-25  6:58 ` [Bug fortran/62049] " wxcvbn789456123-nw6wda at yahoo dot fr
  2015-03-23  5:47 ` jvdelisle at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: wxcvbn789456123-nw6wda at yahoo dot fr @ 2014-08-07 11:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62049

            Bug ID: 62049
           Summary: Negative count_rate when calling system_clock
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wxcvbn789456123-nw6wda at yahoo dot fr

Negative count_rate when calling system_clock

Dear Sirs,

I found that a call to system_clock can return a negative count_rate with
gfortran. 
This problem does not occur with ifort.

Operating system = Microsoft Windows XP SP3

gfortran : downloaded from :
http://users.humboldt.edu/finneyb/gfortran-windows-20140629.exe

Example under a Cygwin session : 

bash 2 : uname -smo
CYGWIN_NT-5.1 i686 Cygwin
bash 3 : gfortran --version
GNU Fortran (GCC) 4.10.0 20140629 (experimental) [trunk revision 212119]
Copyright (C) 2014 Free Software Foundation, Inc.

bash 4 : cat clock.f90

PROGRAM clock
IMPLICIT NONE
INTEGER :: crate
CALL system_clock (count_rate = crate)
WRITE(*,6000) crate
6000 FORMAT(1X,"count_rate = ",I0)
END PROGRAM clock

bash 5 : gfortran clock.f90 -o g.exe
bash 6 : ./g.exe
 count_rate = -1128267296

bash 7 : ifort /nologo clock.f90 /exe:i.exe
bash 8 : ./i.exe
 count_rate = 10000

Can this behavior be considered as a bug?

Greetings

Paul


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/62049] Negative count_rate when calling system_clock
  2014-08-07 11:09 [Bug fortran/62049] New: Negative count_rate when calling system_clock wxcvbn789456123-nw6wda at yahoo dot fr
@ 2014-08-25  6:58 ` wxcvbn789456123-nw6wda at yahoo dot fr
  2015-03-23  5:47 ` jvdelisle at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: wxcvbn789456123-nw6wda at yahoo dot fr @ 2014-08-25  6:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62049

--- Comment #2 from Paul Martin <wxcvbn789456123-nw6wda at yahoo dot fr> ---
Below is the output of the program given in Comment #1 , using the same version 
of gfortran and the same operating system (32 bits) as in Comment #0 :


bash 2 : gfortran --version | head -3
GNU Fortran (GCC) 4.10.0 20140629 (experimental) [trunk revision 212119]
Copyright (C) 2014 Free Software Foundation, Inc.

bash 3 : cat t.f90
PROGRAM clock
   IMPLICIT NONE
   INTEGER(kind=4) :: crate4
   INTEGER(kind=8) :: crate8
   CALL system_clock (count_rate = crate4)
   WRITE(*,*) crate4
   CALL system_clock (count_rate = crate8)
   WRITE(*,*) crate8
END PROGRAM clock

bash 4 : gfortran -Wall t.f90 -fdump-parse-tree

Namespace: A-Z: (UNKNOWN 0)
procedure name = clock
  symtree: 'clock'       || symbol: 'clock'
    type spec : (UNKNOWN 0)
    attributes: (PROGRAM PUBLIC  SUBROUTINE)
  symtree: 'crate4'      || symbol: 'crate4'
    type spec : (INTEGER 4)
    attributes: (VARIABLE )
  symtree: 'crate8'      || symbol: 'crate8'
    type spec : (INTEGER 8)
    attributes: (VARIABLE )
  symtree: 'system_clock'|| symbol: 'system_clock'
    type spec : (UNKNOWN 0)
    attributes: (PROCEDURE  SUBROUTINE)

  code:
  CALL _gfortran_system_clock_8 (((arg not-present)) (count_rate =
clock:crate4) ((arg not-present)))
  WRITE UNIT=6 FMT=-1
  TRANSFER clock:crate4
  DT_END
  CALL _gfortran_system_clock_8 (((arg not-present)) (count_rate =
clock:crate8) ((arg not-present)))
  WRITE UNIT=6 FMT=-1
  TRANSFER clock:crate8
  DT_END

------------------------------------------

bash 5 : ./a.exe
 -1128237296
           3166730000


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/62049] Negative count_rate when calling system_clock
  2014-08-07 11:09 [Bug fortran/62049] New: Negative count_rate when calling system_clock wxcvbn789456123-nw6wda at yahoo dot fr
  2014-08-25  6:58 ` [Bug fortran/62049] " wxcvbn789456123-nw6wda at yahoo dot fr
@ 2015-03-23  5:47 ` jvdelisle at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2015-03-23  5:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62049

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |jvdelisle at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
This PR has been fixed.  See PR64432


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-23  4:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-07 11:09 [Bug fortran/62049] New: Negative count_rate when calling system_clock wxcvbn789456123-nw6wda at yahoo dot fr
2014-08-25  6:58 ` [Bug fortran/62049] " wxcvbn789456123-nw6wda at yahoo dot fr
2015-03-23  5:47 ` jvdelisle at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).