http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46897
--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> --- Draft patch: --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -9299,4 +9299,5 @@ get_temp_from_expr (gfc_expr *e, gfc_namespace *ns) tmp->n.sym->attr.dimension = 0; + gfc_commit_symbol (tmp->n.sym); gfc_set_sym_referenced (tmp->n.sym); gfc_add_flavor (&tmp->n.sym->attr, FL_VARIABLE, name, NULL);