------- Comment #10 from burnus at gcc dot gnu dot org 2009-03-31 20:02 -------
(In reply to comment #9)
> I guess it is the gfc_add_flavor call removal from gfc_add_in_common that
> causes this, attr->flavor in this case is FL_UNKNOWN.
Good guess: The problem is a check in gfc_create_module_variable.
I tried the following patch, but it still fails - FL_VARIABLE is properly set
but
if (sym->attr.use_assoc || sym->attr.in_common)
return;
comes just before the
/* We always want module variables to be created. */
sym->attr.referenced = 1;
Index: resolve.c
===================================================================
--- resolve.c (revision 145366)
+++ resolve.c (working copy)
@@ -719,6 +719,9 @@ resolve_common_vars (gfc_symbol *sym, bo
gfc_error_now ("Derived type variable '%s' in COMMON at %L "
"may not have default initializer", csym->name,
&csym->declared_at);
+
+ if (csym->attr.flavor == FL_UNKNOWN && !csym->attr.proc_pointer)
+ gfc_add_flavor (&csym->attr, FL_VARIABLE, csym->name,
&csym->declared_at);
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39594