kl-nrb:~$ cat buggy.f90 
program main
  implicit none
  character(4) :: a(2)
  print *,fun(a)
contains
  function fun(arg)
    character(len=*), intent(in) :: arg(:)
    integer :: fun(size(arg))
    fun = 5
  end function fun
end pkl-nrb:~$ gfortran41 buggy.f90 
buggy.f90:4: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

If I change the length of 'arg' to a constant it works, and if I assign the
function result to a temporary variable before I print, it also works.


-- 
           Summary: ICE: PRINTing function result of size depending on
                    assumed length CHARACTER dummy
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eedelman at gcc dot gnu dot org


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

Reply via email to