diff options
author | Tobias Burnus <burnus@gcc.gnu.org> | 2010-02-09 18:32:53 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-02-09 18:32:53 +0100 |
commit | 6f117ca583179cf2e02360d94bb0129066049a35 (patch) | |
tree | 61f1f8b7c7f419da28d07bc6a304ff976514b273 /gcc/fortran/module.c | |
parent | e76e92315f3d212bbadf61accdf2548f86393871 (diff) | |
download | gcc-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/module.c')
-rw-r--r-- | gcc/fortran/module.c | 13 |
1 files changed, 13 insertions, 0 deletions
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); } } |