https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78746
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #21 from anlauf at gcc dot gnu.org --- Potential fix: diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index fa6f756d285..891db391907 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -14384,7 +14396,7 @@ resolve_component (gfc_component *c, gfc_symbol *sym) /* F2008, C448. */ if (c->ts.type == BT_CLASS) { - if (CLASS_DATA (c)) + if (c->attr.class_ok && CLASS_DATA (c)) { attr = &(CLASS_DATA (c)->attr); At least valgrind is happy with that change.