diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-15 10:16:46 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-15 10:16:46 +0000 |
commit | 2c50fdd66f8d059892aecaf44c5602c4dad7d203 (patch) | |
tree | e56ac09484435b14670df33d28d7df2ac5029a89 /libgfortran/io/transfer.c | |
parent | 84ff72e41ba3ded126d0f411fdc68581ecbe17d0 (diff) | |
download | gcc-2c50fdd66f8d059892aecaf44c5602c4dad7d203.tar.gz |
2007-05-15 Tobias Burnus <burnus@net-b.de>
PR libfortran/31915
* io/transfer.c (unformatted_read): Use proper size for real(10).
(unformatted_write): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/transfer.c')
-rw-r--r-- | libgfortran/io/transfer.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 9735aae7cce..6d23e5e81b9 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -721,12 +721,13 @@ unformatted_read (st_parameter_dt *dtp, bt type, p = dest; /* By now, all complex variables have been split into their - constituent reals. For types with padding, we only need to - read kind bytes. We don't care about the contents - of the padding. If we hit a short record, then sz is - adjusted accordingly, making later reads no-ops. */ + constituent reals. */ - sz = kind; + if (type == BT_REAL || type == BT_COMPLEX) + sz = size_from_real_kind (kind); + else + sz = kind; + for (i=0; i<nelems; i++) { read_block_direct (dtp, buffer, &sz); @@ -767,11 +768,13 @@ unformatted_write (st_parameter_dt *dtp, bt type, p = source; /* By now, all complex variables have been split into their - constituent reals. For types with padding, we only need to - read kind bytes. We don't care about the contents - of the padding. */ + constituent reals. */ + + if (type == BT_REAL || type == BT_COMPLEX) + sz = size_from_real_kind (kind); + else + sz = kind; - sz = kind; for (i=0; i<nelems; i++) { reverse_memcpy(buffer, p, size); |