]> gcc.gnu.org Git - gcc.git/commitdiff
re PR libfortran/23428 (inquire(iolength= ) for complex give incorrect value)
authorThomas Koenig <Thomas.Koenig@online.de>
Tue, 16 Aug 2005 20:26:04 +0000 (20:26 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 16 Aug 2005 20:26:04 +0000 (20:26 +0000)
2005-08-16  Thomas Koenig  <Thomas.Koenig@online.de>

PR libfortran/23428
* io/transfer.c (iolength_transfer):  Remove __attribute__ ((unused))
from type.  Return correct length for inquire(iolength=)
for complex variables.

2005-08-16  Thomas Koenig  <Thomas.Koenig@online.de>

PR libfortran/23428
* gfortran.dg/inquire-complex.f90:  New test case.

From-SVN: r103168

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/inquire-complex.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/transfer.c

index 75ab35f69630cd97ce3e72ba57fff1cb2d7e7f83..179e2dc99b53f8697156dc8a22fb8c46dcb21407 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-16  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/23428
+       * gfortran.dg/inquire-complex.f90:  New test case.
+
 2005-08-16  James E Wilson  <wilson@specifix.com>
 
        PR tree-optimization/21105
diff --git a/gcc/testsuite/gfortran.dg/inquire-complex.f90 b/gcc/testsuite/gfortran.dg/inquire-complex.f90
new file mode 100644 (file)
index 0000000..188c932
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do run }
+! PR 23428:  Inquire(iolength) used to give the wrong result.
+program main
+  implicit none
+  integer s4, s8
+  
+  complex(kind=8) c8
+  complex(kind=4) c4
+  
+  inquire (iolength=s) c8
+  if (s4 /= 8 .or. s8 /= 16) call abort
+
+end program main
index 223567c7c4255eccaf79afe349c41e51bfec2daa..7ed94299cdc45a18723fa1eefc228a1ad17cd4b5 100644 (file)
@@ -1,3 +1,10 @@
+2005-08-16  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/23428
+       * io/transfer.c (iolength_transfer):  Remove __attribute__ ((unused))
+       from type.  Return correct length for inquire(iolength=)
+       for complex variables.
+
 2005-08-11  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
            Steven Bosscher  <stevenb@suse.de>
 
index 00e8c3101d1b2ca8b0eab637d8b818e9da3e2e3b..03708f84da184d7280c79be4037d08a598e1eb66 100644 (file)
@@ -1536,12 +1536,16 @@ finalize_transfer (void)
    data transfer, it just updates the length counter.  */
 
 static void
-iolength_transfer (bt type   __attribute__ ((unused)),
-                  void *dest __attribute__ ((unused)),
+iolength_transfer (bt type , void *dest __attribute__ ((unused)),
                   int len)
 {
   if (ioparm.iolength != NULL)
-    *ioparm.iolength += len;
+    {
+      if (type == BT_COMPLEX)
+       *ioparm.iolength += 2*len;
+      else
+       *ioparm.iolength += len;
+    }
 }
 
 
This page took 0.097981 seconds and 5 git commands to generate.