diff options
author | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-09 19:43:27 +0000 |
---|---|---|
committer | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-09 19:43:27 +0000 |
commit | d8877715f819d2506a540114bcf3194711ae54f9 (patch) | |
tree | 0f31fdfb3c3dd3af7b89a407ebda9e2ea89c4f54 | |
parent | 79f86a88dadbf33f49759c47f5ddc1c2b709e03e (diff) | |
download | gcc-d8877715f819d2506a540114bcf3194711ae54f9.tar.gz |
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-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
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/reshape-complex.f90 | 5 | ||||
-rw-r--r-- | libgfortran/ChangeLog | 10 | ||||
-rw-r--r-- | libgfortran/generated/reshape_c4.c | 6 | ||||
-rw-r--r-- | libgfortran/generated/reshape_c8.c | 6 | ||||
-rw-r--r-- | libgfortran/generated/reshape_i4.c | 6 | ||||
-rw-r--r-- | libgfortran/generated/reshape_i8.c | 6 | ||||
-rw-r--r-- | libgfortran/m4/reshape.m4 | 6 |
8 files changed, 36 insertions, 15 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe3197c1e08..92f5a6789aa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/gfortran.dg/reshape-complex.f90 b/gcc/testsuite/gfortran.dg/reshape-complex.f90 index 87c80498494..72cafe4f464 100644 --- a/gcc/testsuite/gfortran.dg/reshape-complex.f90 +++ b/gcc/testsuite/gfortran.dg/reshape-complex.f90 @@ -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 diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index ac9fce5281b..86a04e804b2 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -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 diff --git a/libgfortran/generated/reshape_c4.c b/libgfortran/generated/reshape_c4.c index 02d73d258d1..4a9c14d56f6 100644 --- a/libgfortran/generated/reshape_c4.c +++ b/libgfortran/generated/reshape_c4.c @@ -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; diff --git a/libgfortran/generated/reshape_c8.c b/libgfortran/generated/reshape_c8.c index e6ddf1a1bb9..c12735a4e1e 100644 --- a/libgfortran/generated/reshape_c8.c +++ b/libgfortran/generated/reshape_c8.c @@ -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; diff --git a/libgfortran/generated/reshape_i4.c b/libgfortran/generated/reshape_i4.c index b90e56caf4e..465ca24381b 100644 --- a/libgfortran/generated/reshape_i4.c +++ b/libgfortran/generated/reshape_i4.c @@ -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; diff --git a/libgfortran/generated/reshape_i8.c b/libgfortran/generated/reshape_i8.c index 38532c1aac5..41a25ff66ba 100644 --- a/libgfortran/generated/reshape_i8.c +++ b/libgfortran/generated/reshape_i8.c @@ -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; diff --git a/libgfortran/m4/reshape.m4 b/libgfortran/m4/reshape.m4 index 6b411f001ad..ae26a88aef0 100644 --- a/libgfortran/m4/reshape.m4 +++ b/libgfortran/m4/reshape.m4 @@ -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; |