------- Comment #2 from pault at gcc dot gnu dot org 2007-10-25 09:20 ------- (In reply to comment #1) For some reason, the interface mechanism in trans-expr.c is failing for this case of an elemental function (try a constant length for my_func or to make it non-elemental and array valued - both work fince). You can see this in the code that the testcase produces. The internal length variable, in my_func, '..length' is being referenced in the main program, with inevitable consequences!
A workaround, for now, is to write a temporary, which can be allocatable if necessary. character(8) :: temp(4) ......snip...... temp = myfunc (indata)) call process (temp) A tricky alternative, to make use of automatic allocation and cleanup of allocatable components, would be type mytype character(8), allocatable :: c(:) end type mytype type(mytype) :: temp ......snip...... temp%c = myfunc (indata)) call process (temp%c) However, this segfaults for the same reason as the original. *sigh* Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33888