[Bug fortran/16236] New: ICE with function returning string of variable length

anlauf at hep dot tu-darmstadt dot de gcc-bugzilla@gcc.gnu.org
Sun Jun 27 20:20:00 GMT 2004


File: gfortran-bug3.f90

module trivial
contains
  function my_copy(str) result(s)
  implicit none
  character(*), intent(in):: str
  character(len(str)) s
  s = str
  return
  end function my_copy
end module trivial

program boom
  use trivial
  implicit none
  print *, my_copy('Boom!')
end program boom

Result:

% gfortran gfortran-bug3.f90 
f951: ../../gcc/gcc/fortran/trans-expr.c:1042: gfc_conv_function_call: Assertion
`sym->ts.cl && sym->ts.cl->length && sym->ts.cl->length->expr_type ==
EXPR_CONSTANT' failed.
gfortran-bug3.f90: In function `MAIN__':
gfortran-bug3.f90:15: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-- 
           Summary: ICE with function returning string of variable length
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at hep dot tu-darmstadt dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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



More information about the Gcc-bugs mailing list