aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@gcc.gnu.org>2010-02-09 18:32:53 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2010-02-09 18:32:53 +0100
commit6f117ca583179cf2e02360d94bb0129066049a35 (patch)
tree61f1f8b7c7f419da28d07bc6a304ff976514b273 /gcc/fortran
parente76e92315f3d212bbadf61accdf2548f86393871 (diff)
downloadgcc-6f117ca583179cf2e02360d94bb0129066049a35.zip
gcc-6f117ca583179cf2e02360d94bb0129066049a35.tar.gz
gcc-6f117ca583179cf2e02360d94bb0129066049a35.tar.bz2
[multiple changes]
2010-02-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/41869 * module.c (fix_mio_expr): Fix for private generic procedures. 2010-02-09 Tobias Burnus <burnus@net-b.de> PR fortran/41869 * gfortran.dg/module_write_1.f90: New test. From-SVN: r156631
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/module.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3c6d009..f922b4e 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41869
+ * module.c (fix_mio_expr): Fix for private generic procedures.
+
2010-02-09 Daniel Kraft <d@domob.eu>
PR fortran/39171
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index c72cac1..36db863 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -2934,6 +2934,19 @@ fix_mio_expr (gfc_expr *e)
fname = e->value.function.esym ? e->value.function.esym->name
: e->value.function.isym->name;
e->symtree = gfc_find_symtree (gfc_current_ns->sym_root, fname);
+
+ if (e->symtree)
+ return;
+
+ /* This is probably a reference to a private procedure from another
+ module. To prevent a segfault, make a generic with no specific
+ instances. If this module is used, without the required
+ specific coming from somewhere, the appropriate error message
+ is issued. */
+ gfc_get_symbol (fname, gfc_current_ns, &sym);
+ sym->attr.flavor = FL_PROCEDURE;
+ sym->attr.generic = 1;
+ e->symtree = gfc_find_symtree (gfc_current_ns->sym_root, fname);
}
}