2010-07-26 Tobias Burnus <burnus@net-b.de>
PR fortran/45066
* trans-io.c (build_dt): Use NULL_TREE rather than NULL
for call to transfer_namelist_element.
* trans-decl.c (gfc_get_symbol_decl): Also set sym->backend_decl
for -fwhole-file.
2010-07-26 Tobias Burnus <burnus@net-b.de>
PR fortran/45066
* gfortran.dg/namelist_62.f90: New.
===================================================================
@@ -0,0 +1,20 @@
+! { dg-do compile }
+!
+! PR fortran/45066
+!
+! Contributed by Michael Richmond.
+!
+! Was failing due to a -fwhole-file bug.
+!
+
+MODULE GA_commons
+ INTEGER :: nichflg(2)
+END MODULE GA_commons
+
+PROGRAM gafortran
+ USE GA_commons
+ NAMELIST /ga/ nichflg
+ READ (23, nml=ga)
+END PROGRAM gafortran
+
+! { dg-final { cleanup-modules "ga_commons" } }
===================================================================
@@ -1760,7 +1760,7 @@ build_dt (tree function, gfc_code * code
for (nml = dt->namelist->namelist; nml; nml = nml->next)
transfer_namelist_element (&block, nml->sym->name, nml->sym,
- NULL, NULL);
+ NULL, NULL_TREE);
}
else
set_parameter_const (&block, var, IOPARM_common_flags, mask);
===================================================================
@@ -1150,7 +1150,8 @@ gfc_get_symbol_decl (gfc_symbol * sym)
true);
if (sym->ts.type == BT_CHARACTER)
sym->ts.u.cl->backend_decl = s->ts.u.cl->backend_decl;
- return s->backend_decl;
+ sym->backend_decl = s->backend_decl;
+ return sym->backend_decl;
}
}
}