This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/16236] New: ICE with function returning string of variable length
- From: "anlauf at hep dot tu-darmstadt dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2004 20:12:12 -0000
- Subject: [Bug fortran/16236] New: ICE with function returning string of variable length
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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