This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31196] wrong code generated with RESHAPE/TRANSPOSE
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Mar 2007 22:46:16 -0000
- Subject: [Bug fortran/31196] wrong code generated with RESHAPE/TRANSPOSE
- References: <bug-31196-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from tkoenig at gcc dot gnu dot org 2007-03-18 22:46 -------
(In reply to comment #1)
> Expected result:
> 1 3 2 4
> Gfortran:
> 1 3 1 3
>
> This is correctly calculated with g95, NAG f95 and sunf95.
> gfortran compiles and gives the wrong result and ifort gives an ICE.
Interestingly enough, this works for integers.
Slightly reduced test case:
program main
implicit none
TYPE datatype
INTEGER :: I
END TYPE datatype
TYPE(datatype) :: data(2,2)
data(1,1)%i = 1
data(2,1)%i = 2
data(1,2)%i = 3
data(2,2)%i = 4
print *,data(:,:)%i
data=reshape(transpose(data),shape(data))
print *,data(:,:)
END program main
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31196