Index: simplify.c
===================================================================
--- simplify.c (revision 124412)
+++ simplify.c (working copy)
@@ -2136,14 +2136,15 @@ gfc_simplify_len (gfc_expr *e)
}
if (e->ts.cl != NULL && e->ts.cl->length != NULL
- && e->ts.cl->length->expr_type == EXPR_CONSTANT)
+ && e->ts.cl->length->expr_type == EXPR_CONSTANT
+ && e->ts.cl->length->ts.type == BT_INTEGER)
{
result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind,
&e->where);
mpz_set (result->value.integer, e->ts.cl->length->value.integer);
return range_check (result, "LEN");
}