diff options
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 | 18 | ||||
| -rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
| -rw-r--r-- | libgfortran/intrinsics/reshape_generic.c | 2 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e8650e4..8f31532 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-03-25 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/31196 + * gfortran.dg/reshape_transpose_1.f90: New test. + 2007-03-24 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/30655 diff --git a/gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 b/gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 new file mode 100644 index 0000000..5ca5264 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! PR 31196 - reshape of transposed derived types generated +! wront results. +program main + implicit none + TYPE datatype + INTEGER :: I + END TYPE datatype + character (len=20) line1, line2 + TYPE(datatype), dimension(2,2) :: data, result + data(1,1)%i = 1 + data(2,1)%i = 2 + data(1,2)%i = 3 + data(2,2)%i = 4 + write (unit=line1, fmt="(4I4)") reshape(transpose(data),shape(data)) + write (unit=line2, fmt="(4I4)") (/ 1, 3, 2, 4 /) + if (line1 /= line2) call abort +END program main diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 1281bbb..b0b4f19 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2007-03-25 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/31196 + * intrinsics/reshape_generic.c (reshape_internal): Increment + correct variable. + 2007-03-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/31052 diff --git a/libgfortran/intrinsics/reshape_generic.c b/libgfortran/intrinsics/reshape_generic.c index c58fab0..9a20c19 100644 --- a/libgfortran/intrinsics/reshape_generic.c +++ b/libgfortran/intrinsics/reshape_generic.c @@ -266,7 +266,7 @@ reshape_internal (parray *ret, parray *source, shape_type *shape, else { scount[n]++; - sptr += sstride[n] * size; + src += sstride[n] * size; } } } |
