https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97768
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'd have thought doing it inside of if (ex->ts.u.cl && ex->ts.u.cl->length) conditional and testing for ex->ts.u.cl->length->expr_type instead. Plus for the CHARACTER case, it doesn't need to use buffer and can just return "CHARACTER";