diff mbox series

[fortran,committed] Fix PR 89981, rejects valid

Message ID e5ef3f24-693a-de9a-b56d-cf3d6cf9410f@netcologne.de
State New
Headers show
Series [fortran,committed] Fix PR 89981, rejects valid | expand

Commit Message

Thomas Koenig April 6, 2019, 2:21 p.m. UTC
Hello world,

I have attached the patch below as obvious and simple (it is a
one-liner). The problem was a latent bug exposed by my recent
commit for PR 78865, where the check for subroutine entries
was done on the main symbol instead of the entry.  Provision
for doing this for the entry master were already in place,
I simply added the condition for the entry itself.

I will wait a week or so before committing to gcc-8, the only
other affected branch.

Regards

	Thomas

2019-04-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/89981
	* resolve.c (resolve_global_procedure): If the global symbol is an
	ENTRY, also look up its name among the entries.

2019-04-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/89981
	* gfortran.dg/entry_22.f90: New test.
diff mbox series

Patch

Index: resolve.c
===================================================================
--- resolve.c	(Revision 269895)
+++ resolve.c	(Arbeitskopie)
@@ -2546,7 +2546,7 @@  resolve_global_procedure (gfc_symbol *sym, locus *
 	  if (gsym->binding_label && gsym->sym_name != def_sym->name)
 	    gfc_find_symbol (gsym->sym_name, gsym->ns, 0, &def_sym);
 
-	  if (def_sym->attr.entry_master)
+	  if (def_sym->attr.entry_master || def_sym->attr.entry)
 	    {
 	      gfc_entry_list *entry;
 	      for (entry = gsym->ns->entries; entry; entry = entry->next)