gcc/fortran/ChangeLog:
	PR fortran/108421
	* interface.cc (get_expr_storage_size): Check that we actually have
	an integer value before trying to extract it with mpz_get_si.
gcc/testsuite/ChangeLog:
	PR fortran/108421
	* gfortran.dg/pr108421.f90: New test.
   if (e->ts.type == BT_CHARACTER)
     {
       if (e->ts.u.cl && e->ts.u.cl->length
-          && e->ts.u.cl->length->expr_type == EXPR_CONSTANT)
+         && e->ts.u.cl->length->expr_type == EXPR_CONSTANT
+         && e->ts.u.cl->length->ts.type == BT_INTEGER)
        strlen = mpz_get_si (e->ts.u.cl->length->value.integer);
       else if (e->expr_type == EXPR_CONSTANT
               && (e->ts.u.cl == NULL || e->ts.u.cl->length == NULL))
 
--- /dev/null
+! { dg-do compile }
+! PR fortran/108421
+! Contributed by G.Steinmetz
+
+program p
+  character(real(3)) :: c ! { dg-error "must be of INTEGER type" }
+  call s(c)
+end
+subroutine s(x)
+  character(*) :: x
+end