------- Comment #10 from burnus at gcc dot gnu dot org 2008-11-12 23:42 ------- Some debugging shows that sym->name is "same" and sym->attr.function == 1. Furthermore is arg1->expr_type == EXPR_FUNCTION and arg1->ts.cl->length == NULL.
(For cross referencing: http://gcc.gnu.org/ml/fortran/2007-12/msg00160.html is the mail to the patch which added the TODO line.) Using the following patch and calling xmain, the program prints "size(labels)= 1". --- trans-expr.c (Revision 141811) +++ trans-expr.c @@ -1912,8 +1912,9 @@ gfc_map_intrinsic_function (gfc_expr *ex case GFC_ISYM_LEN: /* TODO figure out why this condition is necessary. */ if (sym->attr.function - && arg1->ts.cl->length->expr_type != EXPR_CONSTANT - && arg1->ts.cl->length->expr_type != EXPR_VARIABLE) + && (arg1->ts.cl->length == NULL + || (arg1->ts.cl->length->expr_type != EXPR_CONSTANT + && arg1->ts.cl->length->expr_type != EXPR_VARIABLE))) return false; new_expr = gfc_copy_expr (arg1->ts.cl->length); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38095