This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31609] module that calls a contained function with an ENTRY point
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jul 2007 16:22:41 -0000
- Subject: [Bug fortran/31609] module that calls a contained function with an ENTRY point
- References: <bug-31609-14284@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from pault at gcc dot gnu dot org 2007-07-30 16:22 -------
To my amazement, the patch below fixes the problem and, I am pretty sure, will
complete its regtest OK.
Before posting it, I want to thoroughly check that I have understood the
problem and that the fix is valid.
Cheers
Paul
Index: /svn/trunk/gcc/fortran/resolve.c
===================================================================
*** /svn/trunk/gcc/fortran/resolve.c (revision 127061)
--- /svn/trunk/gcc/fortran/resolve.c (working copy)
*************** resolve_entries (gfc_namespace *ns)
*** 390,396 ****
gfc_namespace *old_ns;
gfc_code *c;
gfc_symbol *proc;
! gfc_entry_list *el;
char name[GFC_MAX_SYMBOL_LEN + 1];
static int master_count = 0;
--- 390,396 ----
gfc_namespace *old_ns;
gfc_code *c;
gfc_symbol *proc;
! gfc_entry_list *el, *el2;
char name[GFC_MAX_SYMBOL_LEN + 1];
static int master_count = 0;
*************** resolve_entries (gfc_namespace *ns)
*** 431,436 ****
--- 431,444 ----
&& ns->parent && ns->parent->proc_name->attr.flavor == FL_MODULE)
el->sym->ns = ns;
+ /* Do the same for entries where the master is not a module
+ procedure. These are retained in the module namespace because
+ of the module procedure declaration. */
+ for (el2 = el->next; el2; el2 = el2->next)
+ if (el2->sym->ns->proc_name->attr.flavor == FL_MODULE
+ && el2->sym->attr.mod_proc)
+ el2->sym->ns = ns;
+
/* Add an entry statement for it. */
c = gfc_get_code ();
c->op = EXEC_ENTRY;
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2007-04-17 20:56:48 |2007-07-30 16:22:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31609