aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorpault <>2005-11-10 22:24:28 +0000
committerpault <>2005-11-10 22:24:28 +0000
commit983f65bd932aefeb5b2eeac385f163eec11902a0 (patch)
treef8af7b25e393d0bdcc9c501354353285b3dd30cc /gcc/fortran/module.c
parent999ea526407bebd8e8415b182a8fb60fbe89b75b (diff)
2005-11-10 Paul Thomas <pault@gcc.gnu.org>simplify-dom-last-merge
PR fortran/24655 PR fortran/24755 * match.c (recursive_stmt_fcn): Add checks that symtree exists for the expression to weed out inline intrinsic functions and parameters. PR fortran/24409 * module.c (mio_symtree_ref): Correct the patch of 0923 so that a symbol is not substituted for by a the symbol for the module itself and to prevent the promotion of a formal argument. 2005-11-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/24655 PR fortran/24755 * gfortran.dg/recursive_statement_functions.f90: Add statement functions using inline intrinsic functions and parameters to test that they no longer seg-fault. PR fortran/24409 gfortran.dg/nested_modules_4.f90: New test. gfortran.dg/nested_modules_5.f90: New test.
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 763905b9f29..6f978aa293e 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -2113,9 +2113,17 @@ mio_symtree_ref (gfc_symtree ** stp)
namespace to see if the required, non-contained symbol is available
yet. If so, the latter should be written. */
if ((*stp)->n.sym && check_unique_name((*stp)->name))
- ns_st = gfc_find_symtree (gfc_current_ns->sym_root, (*stp)->n.sym->name);
-
- mio_symbol_ref (ns_st ? &ns_st->n.sym : &(*stp)->n.sym);
+ ns_st = gfc_find_symtree (gfc_current_ns->sym_root,
+ (*stp)->n.sym->name);
+
+ /* On the other hand, if the existing symbol is the module name or the
+ new symbol is a dummy argument, do not do the promotion. */
+ if (ns_st && ns_st->n.sym
+ && ns_st->n.sym->attr.flavor != FL_MODULE
+ && !(*stp)->n.sym->attr.dummy)
+ mio_symbol_ref (&ns_st->n.sym);
+ else
+ mio_symbol_ref (&(*stp)->n.sym);
}
else
{