[EMAIL PROTECTED] tmp]$ cat x.f90 program foo implicit none real(kind=kind(1.0d0)), dimension (2, 2):: x, y, z; integer i, j open (10, status="scratch") write (10, *) "0.1000000000E+01 0.0000000000E+00" write (10, *) "0.0000000000E+00 0.1000000000E+01" rewind (10) read (10,*) x print "(2(e20.10))", x print * z = matmul (x, transpose (test ())) print "(2(e20.10))", z do i = 1, size (x, 1) do j = 1, size (x, 2) if (x (i, j) .ne. z (i, j)) call abort () end do end do close (10)
contains function test () result (res) real(kind=kind(1.0d0)), dimension(2,2) :: res rewind (10) read (10,*) res print "(2(e20.10))", res print * end function end [EMAIL PROTECTED] tmp]$ /usr/gcc-4.2/bin/gfortran -static x.f90 [EMAIL PROTECTED] tmp]$ ./a.out 0.1000000000E+01 0.0000000000E+00 0.0000000000E+00 0.1000000000E+01 0.1000000000E+01 0.0000000000E+00 0.0000000000E+00 0.1000000000E+01 0.1000000000E+01 0.0000000000E+00 0.1000000000E+01 0.0000000000E+00 Aborted [EMAIL PROTECTED] tmp]$ -- Summary: Transpose doesn't work on function return Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hjl at lucon dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662