summaryrefslogtreecommitdiffstats
path: root/libgfortran
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-09 19:28:58 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-09 19:28:58 +0000
commitf1b523fe77bddb69aca0162770e9f27efbda1897 (patch)
tree620bf329c4f061adbf111c157f4558d884b93c5e /libgfortran
parent74cd9df8141d2b00353ec8cc672be22353cb9d3f (diff)
downloadppe42-gcc-f1b523fe77bddb69aca0162770e9f27efbda1897.tar.gz
ppe42-gcc-f1b523fe77bddb69aca0162770e9f27efbda1897.zip
2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/37753 * io/transfer.c (unformatted_read): CONVERT_NATIVE is the usual case. Check for kind==1 for non-byte-reversing operation. (unformatted_write): Likewise. 2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/37753 * gfortran.dg/convert_2.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141008 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/io/transfer.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 7905b4cc764..8332fea3522 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/37753
+ * io/transfer.c (unformatted_read): CONVERT_NATIVE
+ is the usual case. Check for kind==1 for non-byte-reversing
+ operation.
+ (unformatted_write): Likewise.
+
2008-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org
PR libfortran/37707
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index cf93a286f98..acc7cbe9b94 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -738,8 +738,8 @@ unformatted_read (st_parameter_dt *dtp, bt type,
{
size_t i, sz;
- if (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE
- || size == 1)
+ if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE)
+ || kind == 1)
{
sz = size * nelems;
if (type == BT_CHARACTER)
@@ -789,8 +789,8 @@ static void
unformatted_write (st_parameter_dt *dtp, bt type,
void *source, int kind, size_t size, size_t nelems)
{
- if (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE ||
- size == 1)
+ if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE)
+ || kind == 1)
{
size_t stride = type == BT_CHARACTER ?
size * GFC_SIZE_OF_CHAR_KIND(kind) : size;
OpenPOWER on IntegriCloud