diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2005-11-10 22:24:28 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2005-11-10 22:24:28 +0000 |
commit | 9081e356a1fbf0133fd25ccfa21fe2e4ee710b20 (patch) | |
tree | f8af7b25e393d0bdcc9c501354353285b3dd30cc /gcc/fortran/module.c | |
parent | c040ffff7577b6798465f6c025de2b1f77cec1e9 (diff) | |
download | gcc-9081e356a1fbf0133fd25ccfa21fe2e4ee710b20.zip gcc-9081e356a1fbf0133fd25ccfa21fe2e4ee710b20.tar.gz gcc-9081e356a1fbf0133fd25ccfa21fe2e4ee710b20.tar.bz2 |
re PR fortran/24655 (ICE with statement function)
2005-11-10 Paul Thomas <pault@gcc.gnu.org>
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.
From-SVN: r106756
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 763905b..6f978aa 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 { |