diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b04f3c50419c..54687eee28dd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-09-28 Tobias Burnus + + PR fortran/45756 + * trans-decl.c (gfc_get_symbol_decl): Use gsym for decl of + module parameters. + 2010-09-27 Tobias Burnus PR fortran/40569 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index d15d673af036..2a4eb958d9e8 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1133,11 +1133,18 @@ gfc_get_symbol_decl (gfc_symbol * sym) if (sym->backend_decl) return sym->backend_decl; + /* Special case for array-valued named constants from intrinsic + procedures; those are inlined. */ + if (sym->attr.use_assoc && sym->from_intmod + && sym->attr.flavor == FL_PARAMETER) + intrinsic_array_parameter = true; + /* If use associated and whole file compilation, use the module declaration. */ if (gfc_option.flag_whole_file - && sym->attr.flavor == FL_VARIABLE - && sym->attr.use_assoc + && (sym->attr.flavor == FL_VARIABLE + || sym->attr.flavor == FL_PARAMETER) + && sym->attr.use_assoc && !intrinsic_array_parameter && sym->module) { gfc_gsymbol *gsym; @@ -1182,12 +1189,6 @@ gfc_get_symbol_decl (gfc_symbol * sym) if (sym->attr.intrinsic) internal_error ("intrinsic variable which isn't a procedure"); - /* Special case for array-valued named constants from intrinsic - procedures; those are inlined. */ - if (sym->attr.use_assoc && sym->from_intmod && sym->attr.dimension - && sym->attr.flavor == FL_PARAMETER) - intrinsic_array_parameter = true; - /* Create string length decl first so that they can be used in the type declaration. */ if (sym->ts.type == BT_CHARACTER)