OSDN Git Service

2005-06-09 Thomas Koenig <Thomas.Koenig@online.de>
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jun 2005 19:43:27 +0000 (19:43 +0000)
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jun 2005 19:43:27 +0000 (19:43 +0000)
PR libfortran/21480
* m4/reshape.m4:  Use sizeof (rtype_name) for sizes to be passed
to reshape_packed.
* generated/reshape_c4.c:  Regenerated.
* generated/reshape_c8.c:  Regenerated.
* generated/reshape_i4.c:  Regenerated.
* generated/reshape_i8.c:  Regenerated.

2005-06-09  Thomas Koenig  <Thomas.Koenig@online.de>

PR libfortran/21480
* gfortran.dg/reshape-complex.f90:  Add a test for a packed
complex array.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100805 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/reshape-complex.f90
libgfortran/ChangeLog
libgfortran/generated/reshape_c4.c
libgfortran/generated/reshape_c8.c
libgfortran/generated/reshape_i4.c
libgfortran/generated/reshape_i8.c
libgfortran/m4/reshape.m4

index fe3197c..92f5a67 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-09  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21480
+       * gfortran.dg/reshape-complex.f90:  Add a test for a packed
+       complex array.
+
 2005-06-09  Nathan Sidwell  <nathan@codesourcery.com>
 
        * gcc.dg/alias-8.c: New.
index 87c8049..72cafe4 100644 (file)
@@ -1,11 +1,16 @@
 ! { dg-do run }
 ! PR 21127:  Reshape of complex didn't work.
+! PR 21480:  Reshape of packed complex arrays didn't work either.
 program main
   complex, dimension(8) :: b
   complex, dimension(2,2) :: a
+  complex, dimension(2) :: c,d
   integer :: i
   b = (/(i,i=1,8)/)
   a = reshape(b(1:8:2),shape(a))
   if (a(1,1) /= (1.0, 0.0) .or. a(2,1) /= (3.0, 0.0) .or.  &
       a(1,2) /= (5.0, 0.0) .or. a(2,2) /= (7.0, 0.0)) call abort
+  c = (/( 3.14, -3.14), (2.71, -2.71)/)
+  d = reshape(c, shape (d))
+  if (any (c .ne. d)) call abort
 end
index ac9fce5..86a04e8 100644 (file)
@@ -1,3 +1,13 @@
+2005-06-09  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/21480
+       * m4/reshape.m4:  Use sizeof (rtype_name) for sizes to be passed
+       to reshape_packed.
+       * generated/reshape_c4.c:  Regenerated.
+       * generated/reshape_c8.c:  Regenerated.
+       * generated/reshape_i4.c:  Regenerated.
+       * generated/reshape_i8.c:  Regenerated.
+
 2005-06-07  Thomas Koenig  <Thomas.Koenig@online.de>
 
        PR libfortran/21926
index 02d73d2..4a9c14d 100644 (file)
@@ -174,9 +174,9 @@ reshape_c4 (gfc_array_c4 * ret, gfc_array_c4 * source, shape_type * shape,
 
   if (rsize != 0 && ssize != 0 && psize != 0)
     {
-      rsize *= 4;
-      ssize *= 4;
-      psize *= 4;
+      rsize *= sizeof (GFC_COMPLEX_4);
+      ssize *= sizeof (GFC_COMPLEX_4);
+      psize *= sizeof (GFC_COMPLEX_4);
       reshape_packed ((char *)ret->data, rsize, (char *)source->data,
                      ssize, pad ? (char *)pad->data : NULL, psize);
       return;
index e6ddf1a..c12735a 100644 (file)
@@ -174,9 +174,9 @@ reshape_c8 (gfc_array_c8 * ret, gfc_array_c8 * source, shape_type * shape,
 
   if (rsize != 0 && ssize != 0 && psize != 0)
     {
-      rsize *= 8;
-      ssize *= 8;
-      psize *= 8;
+      rsize *= sizeof (GFC_COMPLEX_8);
+      ssize *= sizeof (GFC_COMPLEX_8);
+      psize *= sizeof (GFC_COMPLEX_8);
       reshape_packed ((char *)ret->data, rsize, (char *)source->data,
                      ssize, pad ? (char *)pad->data : NULL, psize);
       return;
index b90e56c..465ca24 100644 (file)
@@ -174,9 +174,9 @@ reshape_4 (gfc_array_i4 * ret, gfc_array_i4 * source, shape_type * shape,
 
   if (rsize != 0 && ssize != 0 && psize != 0)
     {
-      rsize *= 4;
-      ssize *= 4;
-      psize *= 4;
+      rsize *= sizeof (GFC_INTEGER_4);
+      ssize *= sizeof (GFC_INTEGER_4);
+      psize *= sizeof (GFC_INTEGER_4);
       reshape_packed ((char *)ret->data, rsize, (char *)source->data,
                      ssize, pad ? (char *)pad->data : NULL, psize);
       return;
index 38532c1..41a25ff 100644 (file)
@@ -174,9 +174,9 @@ reshape_8 (gfc_array_i8 * ret, gfc_array_i8 * source, shape_type * shape,
 
   if (rsize != 0 && ssize != 0 && psize != 0)
     {
-      rsize *= 8;
-      ssize *= 8;
-      psize *= 8;
+      rsize *= sizeof (GFC_INTEGER_8);
+      ssize *= sizeof (GFC_INTEGER_8);
+      psize *= sizeof (GFC_INTEGER_8);
       reshape_packed ((char *)ret->data, rsize, (char *)source->data,
                      ssize, pad ? (char *)pad->data : NULL, psize);
       return;
index 6b411f0..ae26a88 100644 (file)
@@ -176,9 +176,9 @@ reshape_`'rtype_ccode (rtype * ret, rtype * source, shape_type * shape,
 
   if (rsize != 0 && ssize != 0 && psize != 0)
     {
-      rsize *= rtype_kind;
-      ssize *= rtype_kind;
-      psize *= rtype_kind;
+      rsize *= sizeof (rtype_name);
+      ssize *= sizeof (rtype_name);
+      psize *= sizeof (rtype_name);
       reshape_packed ((char *)ret->data, rsize, (char *)source->data,
                      ssize, pad ? (char *)pad->data : NULL, psize);
       return;