PR fortran/91414 Bugfix for previous commit
authorJanne Blomqvist <jb@gcc.gnu.org>
Tue, 13 Aug 2019 09:04:18 +0000 (12:04 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Tue, 13 Aug 2019 09:04:18 +0000 (12:04 +0300)
Correctly fill master_seed from os_seed.

From-SVN: r274365

libgfortran/intrinsics/random.c

index cad21fedb5770371de42def84c2bf5ebc5f4c388..dd2c46e7ef57403a2edfbfefdbde8632607b9b73 100644 (file)
@@ -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;
     }