if (a->expr->ts.type == BT_CHARACTER
&& a->expr->ts.u.cl && a->expr->ts.u.cl->length
&& a->expr->ts.u.cl->length->expr_type == EXPR_CONSTANT
+ && a->expr->ts.u.cl->length->ts.type == BT_INTEGER
&& f->sym->ts.type == BT_CHARACTER && f->sym->ts.u.cl
&& f->sym->ts.u.cl->length
&& f->sym->ts.u.cl->length->expr_type == EXPR_CONSTANT
+ && f->sym->ts.u.cl->length->ts.type == BT_INTEGER
&& (f->sym->attr.pointer || f->sym->attr.allocatable
|| (f->sym->as && f->sym->as->type == AS_ASSUMED_SHAPE))
&& (mpz_cmp (a->expr->ts.u.cl->length->value.integer,
--- /dev/null
+! { dg-do compile }
+! PR fortran/107707 - ICE in gfc_compare_actual_formal
+! Contributed by G.Steinmetz
+
+program p
+ character(3), allocatable :: c
+ c = 'abc'
+ call s(c)
+contains
+ subroutine s(x)
+ character(real(3)), allocatable :: x ! { dg-error "must be of INTEGER type" }
+ end
+end