public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98577] New: Wrong "count_rate" values with int32 and real32 if the "count" argument is int64.
@ 2021-01-07  4:12 mehdi.chinoune at hotmail dot com
  2021-01-07 11:36 ` [Bug fortran/98577] " anlauf at gcc dot gnu.org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: mehdi.chinoune at hotmail dot com @ 2021-01-07  4:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98577
           Summary: Wrong "count_rate" values with int32 and real32 if the
                    "count" argument is int64.
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mehdi.chinoune at hotmail dot com
  Target Milestone: ---

program main
  use iso_fortran_env
  implicit none
  integer(int32) :: count_32, count_rate_i32
  integer(int64) :: count_64, count_rate_i64
  real(real32) :: count_rate_r32
  real(real64) :: count_rate_r64
  print*, "count(int_32):"
  call system_clock( count_32, count_rate_i32 )
  print*, "count_rate(int32) = ", count_rate_i32
  call system_clock( count_32, count_rate_i64 )
  print*, "count_rate(int64) = ", count_rate_i64
  call system_clock( count_32, count_rate_r32 )
  print*, "count_rate(real32) = ", count_rate_r32
  call system_clock( count_32, count_rate_r64 )
  print*, "count_rate(real64) = ", count_rate_r64
  print*, "count(int_64):"
  call system_clock( count_64, count_rate_i32 )
  print*, "count_rate(int32) = ", count_rate_i32
  call system_clock( count_64, count_rate_i64 )
  print*, "count_rate(int64) = ", count_rate_i64
  call system_clock( count_64, count_rate_r32 )
  print*, "count_rate(real32) = ", count_rate_r32
  call system_clock( count_64, count_rate_r64 )
  print*, "count_rate(real64) = ", count_rate_r64
end program main

$ gfortran bug_gcc_tic.f90 -o test.x
count(int_32):                                                                 
                                                                               
     count_rate(int32) =         1000                                          
                                                                               
          count_rate(int64) =                  1000                            
                                                                               
               count_rate(real32) =    1000.00000                              
                                                                               
                    count_rate(real64) =    1000.0000000000000                 
                                                                               
                         count(int_64):                                        
                                                                               
                              count_rate(int32) =         1000                 
                                                                               
                                   count_rate(int64) =            1000000000   
                                                                               
                                        count_rate(real32) =    1000.00000     
                                                                               
                                             count_rate(real64) =   
1000000000.0000000

$ ifort bug_gcc_tic.f90 -o test.x
 count(int_32):                                                                
                                                                               
      count_rate(int32) =        10000                                         
                                                                               
           count_rate(int64) =                  10000                          
                                                                               
                count_rate(real32) =    10000.00                               
                                                                               
                     count_rate(real64) =    10000.0000000000                  
                                                                               
                          count(int_64):                                       
                                                                               
                               count_rate(int32) =      1000000                
                                                                               
                                    count_rate(int64) =                1000000 
                                                                               
                                         count_rate(real32) =    1000000.      
                                                                               
                                              count_rate(real64) =   
1000000.00000000

I am reporting this because I got wrong time intervals with
system_clock(int64,real32).

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

end of thread, other threads:[~2023-05-14 16:37 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07  4:12 [Bug fortran/98577] New: Wrong "count_rate" values with int32 and real32 if the "count" argument is int64 mehdi.chinoune at hotmail dot com
2021-01-07 11:36 ` [Bug fortran/98577] " anlauf at gcc dot gnu.org
2021-01-07 13:03 ` mehdi.chinoune at hotmail dot com
2021-01-07 16:32 ` kargl at gcc dot gnu.org
2021-01-07 17:28 ` mehdi.chinoune at hotmail dot com
2021-01-07 18:01 ` sgk at troutmask dot apl.washington.edu
2021-01-07 18:49 ` mehdi.chinoune at hotmail dot com
2021-01-07 18:56 ` mehdi.chinoune at hotmail dot com
2021-01-07 20:27 ` sgk at troutmask dot apl.washington.edu
2021-01-07 20:37 ` kargl at gcc dot gnu.org
2021-01-08  6:18 ` mehdi.chinoune at hotmail dot com
2021-01-08  7:21 ` kargl at gcc dot gnu.org
2021-01-08  8:04 ` mehdi.chinoune at hotmail dot com
2021-01-08  8:27 ` mehdi.chinoune at hotmail dot com
2021-01-08 16:12 ` kargl at gcc dot gnu.org
2021-01-08 16:42 ` mehdi.chinoune at hotmail dot com
2021-01-08 16:59 ` kargl at gcc dot gnu.org
2021-01-08 18:43 ` mehdi.chinoune at hotmail dot com
2021-01-08 18:55 ` sgk at troutmask dot apl.washington.edu
2021-01-08 19:19 ` sgk at troutmask dot apl.washington.edu
2021-01-09  2:34 ` mehdi.chinoune at hotmail dot com
2021-01-09  3:43 ` kargl at gcc dot gnu.org
2021-01-09  9:00 ` tkoenig at gcc dot gnu.org
2023-05-14 16:01 ` mehdi.chinoune at hotmail dot com
2023-05-14 16:37 ` tkoenig 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).