https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71196
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #9 from anlauf at gcc dot gnu.org --- The following patch seems to fix some issues of this PR: diff --git a/gcc/fortran/data.cc b/gcc/fortran/data.cc index f7c91437439..e691c341c28 100644 --- a/gcc/fortran/data.cc +++ b/gcc/fortran/data.cc @@ -463,6 +463,10 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index, break; case REF_COMPONENT: + /* Find ultimate component in a chain. */ + if (ref->next && ref->next->type == REF_COMPONENT) + continue; + if (init == NULL) { /* Setup the expression to hold the constructor. */