From f77d27597dd0556c2a788476f52cf7ef4a5c44be Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Tue, 13 Aug 2019 12:04:18 +0300 Subject: [PATCH] PR fortran/91414 Bugfix for previous commit Correctly fill master_seed from os_seed. From-SVN: r274365 --- libgfortran/intrinsics/random.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index cad21fedb57..dd2c46e7ef5 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -358,7 +358,10 @@ init_rand_state (prng_state* rs, const bool locked) uint64_t os_seed; getosrandom (&os_seed, sizeof (os_seed)); for (uint64_t i = 0; i < sizeof (master_state) / sizeof (uint64_t); i++) - master_state[i] = splitmix64 (os_seed); + { + os_seed = splitmix64 (os_seed); + master_state[i] = os_seed; + } njumps = 0; master_init = true; } -- 2.30.2