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

            Bug ID: 64432
           Summary: [5 Regression] SYSTEM_CLOCK(COUNT_RATE=rate) wrong
                    result for integer(4)::rate
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gmx dot de

I just discovered that the 20141227 snapshot breaks SYSTEM_CLOCK when
the COUNT_RATE argument is a 32-bit integer:

% cat gfcbug128.f90
program gfcbug128
  integer(4) :: count_rate, count_max
  call system_clock (count_rate=count_rate)
  call system_clock (count_max=count_max)
  print *, count_rate, count_max
end

GNU Fortran (GCC) 5.0.0 20141227 (experimental)
produces:

% head -11 gfcbug128.f90.003t.original
gfcbug128 ()
{
  integer(kind=4) count_max;
  integer(kind=4) count_rate;

  {
    integer(kind=8) count_rate.0;

    _gfortran_system_clock_8 (0B, &count_rate.0, 0B);
    count_rate = (integer(kind=4)) count_rate.0;
    _gfortran_system_clock_4 (0B, 0B, &count_max);

whereas my 4.9 or other older installations give:

% head -7 gfcbug128.f90.003t.original-49 
gfcbug128 ()
{
  integer(kind=4) count_max;
  integer(kind=4) count_rate;

  _gfortran_system_clock_4 (0B, &count_rate, 0B);
  _gfortran_system_clock_4 (0B, 0B, &count_max);

On my Linux system, the _4 version has count_rate=1000,
the _8 version is 1000000.

:-(

Reply via email to