http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58043

--- Comment #2 from janus at gcc dot gnu.org ---
Here is a reduced test case, which demonstrates the same problem in a somewhat
more compact manner:


program main

  implicit none

  type :: adof_t
    real :: grd(1:2)
  end type

  class(adof_t), allocatable :: dofs(:)

  allocate(dofs(1))
  call adofinit(dofs(1))

  write (*,'(a)') "---- grd in main ----"
  write (*,'(2f12.4)') dofs(1)%grd(1), dofs(1)%grd(2)

contains

  subroutine adofinit (dof)
    class(adof_t) :: dof
    dof%grd = (/ 1., 2. /)
    write (*,'(a)') "---- grd in adofinit ----"
    write (*,'(2f12.4)') dof%grd(1), dof%grd(2)
  end subroutine adofinit

end


The output is

---- grd in adofinit ----
      1.0000      2.0000
---- grd in main ----
      1.0000      0.0000

Reply via email to