[Bug fortran/17918] gfortran .mod files have unusual entries about private common blocks

olchansk at panix dot com gcc-bugzilla@gcc.gnu.org
Sun Oct 10 00:00:00 GMT 2004


------- Additional Comments From olchansk at panix dot com  2004-10-10 00:00 -------
Okey, I see: in module.c, module_write() calls write_common(), which
unconditionally writes out all common blocks. Other write_xxx() functions call
check_access() to skip private stuff, but there is no such call in
write_common(). I remember reporting this problem once before and it was somehow
fixed. Maybe the fix got lost in the merging shuffle.

I propose this fix: add a call to check_access() to write_common() in module.c:

[olchansk@send fortran]$ cvs diff -u module.c
Index: module.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/module.c,v
retrieving revision 1.17
diff -u -r1.17 module.c
--- module.c    16 Sep 2004 16:00:42 -0000      1.17
+++ module.c    9 Oct 2004 23:52:11 -0000
@@ -3169,7 +3169,8 @@
 {
   gfc_common_head *p;
 
-  if (st == NULL)
+  if (st == NULL
+      || !check_access (st->n.common->head->attr.access,
st->n.common->head->ns->default_access))
     return;
 
   write_common(st->left);
[olchansk@send fortran]$

K.O.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17918



More information about the Gcc-bugs mailing list