aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-07-11 01:50:28 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2004-07-11 01:50:28 +0200
commit9cbf8b4131d0e9668eace15277988e8d9beed8f7 (patch)
treeaf1eebbf418849aa2d53f44aca5cb8a0035751c8 /gcc/fortran
parenta53334a410414050de6771bddf44f6febbc51e53 (diff)
downloadgcc-9cbf8b4131d0e9668eace15277988e8d9beed8f7.zip
gcc-9cbf8b4131d0e9668eace15277988e8d9beed8f7.tar.gz
gcc-9cbf8b4131d0e9668eace15277988e8d9beed8f7.tar.bz2
trans-decl.c (gfc_create_module_variable): Nothing to do if symbol is in common, because we ...
fortran/ * trans-decl.c (gfc_create_module_variable): Nothing to do if symbol is in common, because we ... (gfc_generate_module_vars): Call gfc_trans_common. testsuite/ * gfortran.fortran-torture/execute/common_2.f90: Add check for access to common var from module. From-SVN: r84479
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-decl.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 813e7c0..39057f3 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-10 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * trans-decl.c (gfc_create_module_variable): Nothing to do if
+ symbol is in common, because we ...
+ (gfc_generate_module_vars): Call gfc_trans_common.
+
2004-07-10 Paul Brook <paul@codesourcery.com>
* trans-array.c (gfc_build_null_descriptor): New function.
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index b1b5120..4dce18a 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1798,8 +1798,9 @@ gfc_create_module_variable (gfc_symbol * sym)
&& (sym->attr.flavor != FL_PARAMETER || sym->attr.dimension == 0))
return;
- /* Don't generate variables from other modules. */
- if (sym->attr.use_assoc)
+ /* Don't generate variables from other modules. Variables from
+ COMMONs will already have been generated. */
+ if (sym->attr.use_assoc || sym->attr.in_common)
return;
if (sym->backend_decl)
@@ -1867,6 +1868,9 @@ gfc_generate_module_vars (gfc_namespace * ns)
/* Check if the frontend left the namespace in a reasonable state. */
assert (ns->proc_name && !ns->proc_name->tlink);
+ /* Generate COMMON blocks. */
+ gfc_trans_common (ns);
+
/* Create decls for all the module variables. */
gfc_traverse_ns (ns, gfc_create_module_variable);
}