Dear Paul,

first, thanks for the patch.

There is one thing it does not appear to do correctly: It should
also set the dtype on the variable itself:

ig25@linux-fd1f:~/Krempel/H> cat mm.f90
program main
  implicit none
  integer, parameter :: m=10, n=12, count=4
  double precision :: a(m, count), b(count, n), c(m, n)
  double precision, dimension(:,:), allocatable :: tmp

  call random_number(a)
  call random_number(b)
  tmp = matmul(a,b)
  print *,tmp
end program main
ig25@linux-fd1f:~/Krempel/H> gfortran -fdump-tree-original mm.f90
ig25@linux-fd1f:~/Krempel/H> ./a.out
At line 10 of file mm.f90 (unit = 6, file = 'stdout')
Internal Error: list_formatted_write(): Bad type

Apparently, the dtype of tmp is never set:

ig25@linux-fd1f:~/Krempel/H> grep tmp mm.f90.003t.original
  struct array2_real(kind=8) tmp;
      tmp.data = 0B;
        D.1573 = tmp;
          D.1574 = (void *) tmp.data;
        tmp.data = D.1573.data;
        _gfortran_transfer_array_write (&dt_parm.4, &tmp, 8, 0);
      if (tmp.data != 0B)
          __builtin_free ((void *) tmp.data);
      tmp.data = 0B;

Regards,

        Thomas

Reply via email to