2010-07-23 Tobias Burnus <burnus@net-b.de>
+ PR fortran/44945
+ * trans-decl.c (gfc_get_symbol_decl): Use module decl with
+ -fwhole-file also for derived types.
+ * trans-types.c (copy_dt_decls_ifequal): Remove static and
+ rename to gfc_copy_dt_decls_ifequal.
+ (gfc_get_derived_type): Update call.
+ * trans-types.h (gfc_copy_dt_decls_ifequal): Add prototype.
+
+2010-07-23 Tobias Burnus <burnus@net-b.de>
+
PR fortran/45030
* resolve.c (resolve_global_procedure): Properly handle ENTRY.
return sym->backend_decl;
/* If use associated and whole file compilation, use the module
- declaration. This is only needed for intrinsic types because
- they are substituted for one another during optimization. */
+ declaration. */
if (gfc_option.flag_whole_file
&& sym->attr.flavor == FL_VARIABLE
- && sym->ts.type != BT_DERIVED
&& sym->attr.use_assoc
&& sym->module)
{
gfc_find_symbol (sym->name, gsym->ns, 0, &s);
if (s && s->backend_decl)
{
+ if (sym->ts.type == BT_DERIVED)
+ gfc_copy_dt_decls_ifequal (s->ts.u.derived, sym->ts.u.derived,
+ true);
if (sym->ts.type == BT_CHARACTER)
sym->ts.u.cl->backend_decl = s->ts.u.cl->backend_decl;
return s->backend_decl;
the two derived type symbols are "equal", as described
in 4.4.2 and resolved by gfc_compare_derived_types. */
-static int
-copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to,
+int
+gfc_copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to,
bool from_gsym)
{
gfc_component *to_cm;
gfc_find_symbol (derived->name, gsym->ns, 0, &s);
if (s && s->backend_decl)
{
- copy_dt_decls_ifequal (s, derived, true);
+ gfc_copy_dt_decls_ifequal (s, derived, true);
goto copy_derived_types;
}
}
dt = ns->derived_types;
for (; dt && !canonical; dt = dt->next)
{
- copy_dt_decls_ifequal (dt->derived, derived, true);
+ gfc_copy_dt_decls_ifequal (dt->derived, derived, true);
if (derived->backend_decl)
got_canonical = true;
}
copy_derived_types:
for (dt = gfc_derived_types; dt; dt = dt->next)
- copy_dt_decls_ifequal (derived, dt->derived, false);
+ gfc_copy_dt_decls_ifequal (derived, dt->derived, false);
return derived->backend_decl;
}
tree gfc_sym_type (gfc_symbol *);
tree gfc_typenode_for_spec (gfc_typespec *);
+int gfc_copy_dt_decls_ifequal (gfc_symbol *, gfc_symbol *, bool);
tree gfc_get_function_type (gfc_symbol *);
+2010-07-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/44945
+ * gfortran.dg/char_array_structure_constructor.f90: Add
+ -fwhole-file as dg-option as it otherwise fails on some
+ systems.
+
2010-07-23 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/aggr16.ad[sb]: New test.
! { dg-do run }
+! { dg-options "-fwhole-file" }
+!
+! PR fortran/19107
+! -fwhole-file flag added for PR fortran/44945
+!
! This test the fix of PR19107, where character array actual
! arguments in derived type constructors caused an ICE.
! It also checks that the scalar counterparts are OK.