public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran] Fix PR 87734, rejects-valid
@ 2019-03-09 21:27 Thomas Koenig
  2019-03-09 21:52 ` Steve Kargl
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Koenig @ 2019-03-09 21:27 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Hello world,

a recent patch by Steve for PR 88376 fixed an ICE in the test case
for PR 87734, leading further down the path to a rejects-valid bug
in the same test case.  Such is progress :-)

This patch fixes that particular error by not treating module procedures
which have been declared PUBLIC or PRIVATE as simple external
procedures.

This is a 7/8/9 regression, backporting may also include backporting
Steve's patch for PR 88376 (I haven't checked yet).

OK for trunk and the other open branches?

Regards

	Thomas

2019-03-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/87734
         * symbol.c (gfc_add_procedure): Only throw an error if the
         procedure has not been declared either PUBLIC or PRIVATE.

2019-03-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/87734
         * gfortran.dg/public_private_module_10.f90: New test.

[-- Attachment #2: p1.diff --]
[-- Type: text/x-patch, Size: 555 bytes --]

Index: symbol.c
===================================================================
--- symbol.c	(Revision 269524)
+++ symbol.c	(Arbeitskopie)
@@ -1805,7 +1805,8 @@ gfc_add_procedure (symbol_attribute *attr, procedu
   if (where == NULL)
     where = &gfc_current_locus;
 
-  if (attr->proc != PROC_UNKNOWN && !attr->module_procedure)
+  if (attr->proc != PROC_UNKNOWN && !attr->module_procedure
+      && attr->access == ACCESS_UNKNOWN)
     {
       if (attr->proc == PROC_ST_FUNCTION && t == PROC_INTERNAL
 	  && !gfc_notification_std (GFC_STD_F2008))

[-- Attachment #3: public_private_module_10.f90 --]
[-- Type: text/x-fortran, Size: 254 bytes --]

! PR 87734
module m_vstring
  implicit none

  public :: vstring_length

contains

  subroutine vstring_cast()
    character ( len = vstring_length() ) :: char_string
  end subroutine

  pure integer function vstring_length ()
  end function

end module

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch, fortran] Fix PR 87734, rejects-valid
  2019-03-09 21:27 [patch, fortran] Fix PR 87734, rejects-valid Thomas Koenig
@ 2019-03-09 21:52 ` Steve Kargl
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Kargl @ 2019-03-09 21:52 UTC (permalink / raw)
  To: Thomas Koenig; +Cc: fortran, gcc-patches

On Sat, Mar 09, 2019 at 09:57:52PM +0100, Thomas Koenig wrote:
> 
> a recent patch by Steve for PR 88376 fixed an ICE in the test case
> for PR 87734, leading further down the path to a rejects-valid bug
> in the same test case.  Such is progress :-)
> 
> This patch fixes that particular error by not treating module procedures
> which have been declared PUBLIC or PRIVATE as simple external
> procedures.
> 
> This is a 7/8/9 regression, backporting may also include backporting
> Steve's patch for PR 88376 (I haven't checked yet).
> 
> OK for trunk and the other open branches?
> 

OK.

-- 
Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-09 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-09 21:27 [patch, fortran] Fix PR 87734, rejects-valid Thomas Koenig
2019-03-09 21:52 ` Steve Kargl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).