------- Comment #6 from kargl at gcc dot gnu dot org  2009-04-24 17:59 -------
The problem is due to the null() in 

    character(200), pointer :: descrip => null() 

If you comment out this statement or remove '=> null()',
then the code compiles and runs.  A slighly reduced testcase
is

module test_struct

  interface assignment (=)
    module procedure tao_lat_equal_tao_lat
  end interface

  type bunch_params_struct
    integer n_live_particle          
  end type

  type tao_lattice_struct
    type (bunch_params_struct), allocatable :: bunch_params(:)
    type (bunch_params_struct), allocatable :: bunch_params2(:)
  end type

  type tao_universe_struct
    type (tao_lattice_struct), pointer :: model, design
    character(200), pointer :: descrip => null() 
  end type

  type tao_super_universe_struct
    type (tao_universe_struct), allocatable :: u(:)          
  end type

  type (tao_super_universe_struct), save, target :: s

  contains

    subroutine tao_lat_equal_tao_lat (lat1, lat2)
      implicit none
      type (tao_lattice_struct), intent(inout) :: lat1
      type (tao_lattice_struct), intent(in) :: lat2
    end subroutine

end module

program tao_program
  use test_struct
  implicit none
  type (tao_universe_struct), pointer :: u
  integer n
  allocate (s%u(1))
  u => s%u(1)
  allocate (u%design, u%model)
  n = 112
  allocate (u%model%bunch_params(0:n), u%design%bunch_params(0:n))
  u%model = u%design
  u%model = u%design
end program


-- 


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

Reply via email to