From patchwork Wed Jul 25 16:40:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix reading real(kind=10) numbers Date: Wed, 25 Jul 2012 06:40:41 -0000 From: Andreas Schwab X-Patchwork-Id: 173213 Message-Id: To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org This fixes a mixup of kind and size when storing a real(kind=10) number for read, causing a loss of two bytes. Tested on m68k-linux and checked in as obvious. Andreas. * io/list_read.c (list_formatted_read_scalar): Fix copying real value back to temporary. diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 6155d97..9d301d6 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -1888,7 +1888,7 @@ list_formatted_read_scalar (st_parameter_dt *dtp, bt type, void *p, read_real (dtp, p, kind); /* Copy value back to temporary if needed. */ if (dtp->u.p.repeat_count > 0) - memcpy (dtp->u.p.value, p, kind); + memcpy (dtp->u.p.value, p, size); break; case BT_COMPLEX: read_complex (dtp, p, kind, size);