This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] PR 15481: Separate common symbols
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 29 Jun 2004 23:28:47 +0200
- Subject: Re: [gfortran] PR 15481: Separate common symbols
- References: <40DD99B3.1010102@physik.uni-muenchen.de>
Tobias Schlüter wrote:
> Looking over the patch, I see that I didn't install logic to dump common
> blocks. I will fix this once this patch is in.
Done as follows, committed as obvious after I verified that this works
as expected.
- Tobi
2004-06-29 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* dump-parse-tree.c (show_common): New function.
(gfc_show_namespace): Show commons.
Index: dump-parse-tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/dump-parse-tree.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- dump-parse-tree.c 29 Jun 2004 18:56:47 -0000 1.6
+++ dump-parse-tree.c 29 Jun 2004 21:18:10 -0000 1.7
@@ -718,6 +718,27 @@ gfc_traverse_user_op (gfc_namespace * ns
}
+/* Function to display a common block. */
+
+static void
+show_common (gfc_symtree * st)
+{
+ gfc_symbol *s;
+
+ show_indent ();
+ gfc_status ("common: /%s/ ", st->name);
+
+ s = st->n.common->head;
+ while (s)
+ {
+ gfc_status ("%s", s->name);
+ s = s->common_next;
+ if (s)
+ gfc_status (", ");
+ }
+ gfc_status_char ('\n');
+}
+
/* Worker function to display the symbol tree. */
static void
@@ -1432,6 +1453,8 @@ gfc_show_namespace (gfc_namespace * ns)
}
gfc_current_ns = ns;
+ gfc_traverse_symtree (ns->common_root, show_common);
+
gfc_traverse_symtree (ns->sym_root, show_symtree);
for (op = GFC_INTRINSIC_BEGIN; op != GFC_INTRINSIC_END; op++)