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



--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-30 
13:40:27 UTC ---

Reduced test for gfortran.dg/proc_decl_23.f90



module m_string



  type t_string

    procedure(string_to_char), pointer, nopass :: char3 ! segfault

  end type t_string



contains



  function string_to_char (s) result(res)

    character, dimension(:), intent(in) :: s

    character(len=size(s)) :: res

    do i = 1, size(s)

      res(i:i) = s(i)

    end do

  end function string_to_char



end module m_string



  use m_string

  type(t_string) :: t

  print *, string_to_char (["a","b","c"])

end



If 'print *, string_to_char (["a","b","c"])' is commented in the original test,

it compiles and passes.



I also confirm that if the "contains ..." is moved from the module to the

program, the tests compile and run without error for

gfortran.dg/auto_char_len_3.f90 andproc_decl_23.f90.

Reply via email to