aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2008-09-21 19:58:23 +0000
committerPaul Thomas <pault@gcc.gnu.org>2008-09-21 19:58:23 +0000
commitecd3b73c6dde9d7b61b811b3cab3ac823b63c181 (patch)
treeb68949529b16170ec70aaa2df94ddaeea09ee265 /gcc/fortran/resolve.c
parent19047e4a033c61a38aab9156e2bd49ed0e7bc3e5 (diff)
downloadgcc-ecd3b73c6dde9d7b61b811b3cab3ac823b63c181.zip
gcc-ecd3b73c6dde9d7b61b811b3cab3ac823b63c181.tar.gz
gcc-ecd3b73c6dde9d7b61b811b3cab3ac823b63c181.tar.bz2
re PR fortran/37583 (ICE "insert_bbt(): Duplicate key" for self-calling ENTRY subprogram)
2008-09-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/37583 * decl.c (scalarize_intrinsic_call): Both subroutines and functions can give a true for get_proc_mame's last argument so remove the &&gfc_current_ns->proc_name->attr.function. resolve.c (resolve_actual_arglist): Add check for recursion by reference to procedure as actual argument. 2008-09-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/37583 * gfortran.dg/entry_18.f90: New test. From-SVN: r140532
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f8f2df9..a7c62c3 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1176,6 +1176,15 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
/* Just in case a specific was found for the expression. */
sym = e->symtree->n.sym;
+ if (sym->attr.entry && sym->ns->entries
+ && sym->ns == gfc_current_ns
+ && !sym->ns->entries->sym->attr.recursive)
+ {
+ gfc_error ("Reference to ENTRY '%s' at %L is recursive, but procedure "
+ "'%s' is not declared as RECURSIVE",
+ sym->name, &e->where, sym->ns->entries->sym->name);
+ }
+
/* If the symbol is the function that names the current (or
parent) scope, then we really have a variable reference. */