[Bug fortran/56708] New: [4.9 Regression] Failure calling random_seed with optimization

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Mar 24 13:28:00 GMT 2013


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

             Bug #: 56708
           Summary: [4.9 Regression] Failure calling random_seed with
                    optimization
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


ig25@linux-fd1f:~/Krempel/Random> cat random.f90
program main
  implicit none
  call init_random_seed
contains
  SUBROUTINE init_random_seed()
    INTEGER :: i, n, clock
    INTEGER, DIMENSION(:), ALLOCATABLE :: seed

    CALL RANDOM_SEED(size = n)
    ALLOCATE(seed(n))

    CALL SYSTEM_CLOCK(COUNT=clock)

    seed = clock + 37 * (/ (i - 1, i = 1, n) /)
    CALL RANDOM_SEED(PUT = seed)

    DEALLOCATE(seed)
  END SUBROUTINE init_random_seed
end program main

ig25@linux-fd1f:~/Krempel/Random> gfortran random.f90
ig25@linux-fd1f:~/Krempel/Random> ./a.out
ig25@linux-fd1f:~/Krempel/Random> gfortran -O1 random.f90
ig25@linux-fd1f:~/Krempel/Random> ./a.out
Fortran runtime error: Array size of PUT is too small.
ig25@linux-fd1f:~/Krempel/Random> 

I am investigating further to see if 4.8 is also affected.



More information about the Gcc-bugs mailing list