diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-08-15 12:35:57 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-08-15 12:35:57 +0000 |
commit | ee5d176a88399eeb47d76f37531257b62b5f36d3 (patch) | |
tree | 329a6ad9ddc89df708274b59d457f1bd0a0e9cb7 /libgfortran | |
parent | 49317655fe694ad6e5d21de25b68753b3d0c8b87 (diff) | |
download | gcc-ee5d176a88399eeb47d76f37531257b62b5f36d3.tar.gz |
re PR fortran/33077 (RANDOM_SEED failure for integer(kind=8))
PR fortran/33077
* intrinsics/random.c (random_seed_i8): Fix code logic.
* gfortran.dg/random_7.f90: Initialize variable.
From-SVN: r127512
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/intrinsics/random.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index a74bd448151..2305b3e9ed6 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2007-08-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR fortran/33077 + * intrinsics/random.c (random_seed_i8): Fix code logic. + 2007-08-13 Danny Smith <dannysmit@users.sourceforge.net> * acinclude.m4 (GTHREAD_USE_WEAK) Define to 0 for mingw32. diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index f64f21c5b80..00029c5da61 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -731,8 +731,8 @@ random_seed_i8 (GFC_INTEGER_8 *size, gfc_array_i8 *put, gfc_array_i8 *get) runtime_error ("Array size of PUT is too small."); /* This code now should do correct strides. */ - for (i = 0; i < kiss_size; i += 2) - memcpy (&kiss_seed[i], &(put->data[i * put->dim[0].stride]), + for (i = 0; i < kiss_size / 2; i++) + memcpy (&kiss_seed[2*i], &(put->data[i * put->dim[0].stride]), sizeof (GFC_UINTEGER_8)); } @@ -748,8 +748,8 @@ random_seed_i8 (GFC_INTEGER_8 *size, gfc_array_i8 *put, gfc_array_i8 *get) runtime_error ("Array size of GET is too small."); /* This code now should do correct strides. */ - for (i = 0; i < kiss_size; i += 2) - memcpy (&(get->data[i * get->dim[0].stride]), &kiss_seed[i], + for (i = 0; i < kiss_size / 2; i++) + memcpy (&(get->data[i * get->dim[0].stride]), &kiss_seed[2*i], sizeof (GFC_UINTEGER_8)); } |