Always initialize PRNG using random data from the OS.
authorJanne Blomqvist <jb@gcc.gnu.org>
Fri, 19 Aug 2016 14:12:32 +0000 (17:12 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Fri, 19 Aug 2016 14:12:32 +0000 (17:12 +0300)
commit91151a7334543817f1f790310a1bfc4589889cad
tree3dd25be020bc1f538120f175d6ec7627ccda7699
parentf0c90610e3e0646b89ae3e4b20134dc7e1cd7d12
Always initialize PRNG using random data from the OS.

libgfortran:

2016-08-16  Janne Blomqvist  <jb@gcc.gnu.org>

        * intrinsics/random.c (master_init): New variable.
        (init_rand_state): Move below getosrandom (), maybe initialize
        master_state.
        (random_seed_i4): If called with no arguments, set master_init to
        false, and reinitialize. If called with PUT=, set master_init to
        true.
        (random_seed_i8): Likewise.

testsuite:

2016-08-16  Janne Blomqvist  <jb@gcc.gnu.org>

        * gfortran.dg/random_4.f90: Initialize seed before using, handle
        the last special seed value.
        * gfortran.dg/random_7.f90: Use size for last array member instead
        of hardcoded value.

From-SVN: r239611
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/random_4.f90
gcc/testsuite/gfortran.dg/random_7.f90
libgfortran/ChangeLog
libgfortran/intrinsics/random.c