[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    [ patch, fortran, committed] Fix PR 89981, rejects valid
From:       Thomas Koenig <tkoenig () netcologne ! de>
Date:       2019-04-06 14:21:03
Message-ID: e5ef3f24-693a-de9a-b56d-cf3d6cf9410f () netcologne ! de
[Download RAW message or body]

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.

["p1.diff" (text/x-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)

["entry_22.f90" (text/x-fortran)]

! { dg-do compile }
! { dg-additional-options "-pedantic" }
! PR fortran/89981 - this used to give a wrong warning (error with
! -pedantic)
program main
  call bar(i)
  call baz(i) ! { dg-error "Type mismatch in argument" }
end program main
subroutine foo(r)
  entry bar(i)
  entry baz(r)
end subroutine foo


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic