https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68108
--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Tue, Oct 27, 2015 at 10:54:53AM +0000, mikael at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68108 > > --- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> --- > (In reply to kargl from comment #1) > > Tentative patch > > > > Index: decl.c > > =================================================================== > > --- decl.c (revision 229390) > > +++ decl.c (working copy) > > @@ -754,7 +754,8 @@ char_len_param_value (gfc_expr **expr, b > > > > gfc_reduce_init_expr (e); > > > > - if ((e->ref && e->ref->u.ar.type != AR_ELEMENT) > > + if ((e->ref && e->ref->type == REF_ARRAY > > + && e->ref->u.ar.type != AR_ELEMENT) > > || (!e->ref && e->expr_type == EXPR_ARRAY)) > > There is another unguarded ref->u.ar access a few lines above. > It doesn't trigger as often, because it's a == condition, but it's still worth > fixing. > Otherwise looks good. > Thanks for pointing out the other condition. I'll commit the fix later today.