------- Additional Comments From tkoenig at gcc dot gnu dot org 2005-07-19 07:57 ------- No elemental function call necessary, it seems. (The * is probably invalid for this).
Here is another case which exhibits the same behavior: $ cat clen.f90 program main implicit none character(len=2) :: a a = 'xy' print *,fun(a) contains function fun(arg) character(len=*) :: arg character(len=len(arg)) :: fun fun = 'xx' end function fun end program main $ gfortran clen.f90 clen.f90: In function 'MAIN__': clen.f90:5: internal compiler error: in gfc_conv_function_call, at fortran/trans-expr.c:1106 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. $ gfortran -v Using built-in specs. Target: ia64-unknown-linux-gnu Configured with: ../gcc-4.1-20050716/configure --prefix=/home/zfkts --enable- languages=c,f95 Thread model: posix gcc version 4.1.0 20050716 (experimental) We don't handle the specification expression in this case (sym->ts.cl->length->expr_type is EXPR_FUNCTION). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22518