aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-09-15 13:12:52 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-09-15 13:12:52 +0000
commit4672f86ad056e95dbdc570901efd8270056560a9 (patch)
tree69108e85106bf1feaf8ce840dccb533cd594db5d
parent1a141fe10a22a59d30ba8d856fec6483a5e96e33 (diff)
downloadgcc-4672f86ad056e95dbdc570901efd8270056560a9.zip
gcc-4672f86ad056e95dbdc570901efd8270056560a9.tar.gz
gcc-4672f86ad056e95dbdc570901efd8270056560a9.tar.bz2
re PR fortran/16485 (Private subroutines from different modules collide during linking.)
2004-09-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/16485 * module.c (write_symbol): Don't fill in module name here. (write_symbol0): Fill in here instead. testsuite/ * gfortran.dg/same_name_1.f90: New test. From-SVN: r87551
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/module.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/same_name_1.f9013
4 files changed, 26 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 1df48e1..4f0c3a0 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/16485
+ * module.c (write_symbol): Don't fill in module name here.
+ (write_symbol0): Fill in here instead.
+
2004-09-14 Kazu Hirata <kazu@cs.umass.edu>
* data.c, decl.c, f95-lang.c, gfortran.h, match.c,
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 5fabcb0..c5a94d2 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3198,9 +3198,6 @@ write_symbol (int n, gfc_symbol * sym)
mio_integer (&n);
mio_internal_string (sym->name);
- if (sym->module[0] == '\0')
- strcpy (sym->module, module_name);
-
mio_internal_string (sym->module);
mio_pointer_ref (&sym->ns);
@@ -3226,6 +3223,8 @@ write_symbol0 (gfc_symtree * st)
write_symbol0 (st->right);
sym = st->n.sym;
+ if (sym->module[0] == '\0')
+ strcpy (sym->module, module_name);
if (sym->attr.flavor == FL_PROCEDURE && sym->attr.generic
&& !sym->attr.subroutine && !sym->attr.function)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cf289f1..0cf8e98 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/16485
+ * gfortran.dg/same_name_1.f90: New test.
+
2004-09-15 Diego Novillo <dnovillo@redhat.com>
* gcc.c-torture/execute/pr17252.c: Fix thinko. Don't
diff --git a/gcc/testsuite/gfortran.dg/same_name_1.f90 b/gcc/testsuite/gfortran.dg/same_name_1.f90
new file mode 100644
index 0000000..cbeb875
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/same_name_1.f90
@@ -0,0 +1,13 @@
+! { dg-do assemble }
+module n
+private u
+contains
+ subroutine u
+ end subroutine u
+end module n
+module m
+ private :: u
+contains
+ subroutine u
+ end subroutine u
+end module m