re PR fortran/31196 ([4.1 only] wrong code generated with RESHAPE/TRANSPOSE)

2007-03-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/31196
	* intrinsics/reshape_generic.c (reshape_internal):  Increment
	correct variable.

2007-03-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/31196
	* gfortran.dg/reshape_transpose_1.f90:  New test.

From-SVN: r123195
This commit is contained in:
Thomas Koenig 2007-03-25 08:29:10 +00:00
parent 3ece6cc239
commit cc41ec4ebc
4 changed files with 30 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -266,7 +266,7 @@ reshape_internal (parray *ret, parray *source, shape_type *shape,
else
{
scount[n]++;
sptr += sstride[n] * size;
src += sstride[n] * size;
}
}
}