aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog13
-rw-r--r--gcc/fortran/match.c5
-rw-r--r--gcc/fortran/module.c14
3 files changed, 28 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index fbedea28f87..a138bb11ba8 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,16 @@
+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 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/24643
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 8725a5f0399..97e8f5a434f 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -2723,6 +2723,9 @@ recursive_stmt_fcn (gfc_expr *e, gfc_symbol *sym)
return true;
}
+ if (e->symtree == NULL)
+ return false;
+
/* Check the name before testing for nested recursion! */
if (sym->name == e->symtree->n.sym->name)
return true;
@@ -2736,7 +2739,7 @@ recursive_stmt_fcn (gfc_expr *e, gfc_symbol *sym)
break;
case EXPR_VARIABLE:
- if (sym->name == e->symtree->n.sym->name)
+ if (e->symtree && sym->name == e->symtree->n.sym->name)
return true;
break;
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
{