public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/50525] gfortran should not allow early reference to entry dummy argument  (r178939)
Date: Tue, 27 Sep 2011 14:40:00 -0000	[thread overview]
Message-ID: <bug-50525-4-uub8RgDhlz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50525-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50525

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-27 14:27:39 UTC ---
The patch causes regressions as it comes before the check in resolve_variable
(search for "before the ENTRY", which covers a similar issue (cf PR 25090).
Namely:
  gfortran.dg/entry_dummy_ref_1.f90
  gfortran.dg/entry_dummy_ref_2.f90

False positive - ("n" used in a specification expression):
  gfortran.dg/entry_array_specs_2.f

 * * *

From the F2008 standard ("12.6.2.6 ENTRY statement", para 7):
  "In a subprogram, a name that appears as a dummy argument in an ENTRY 
   statement shall not appear in an executable statement preceding that ENTRY 
   statement, unless it also appears in a FUNCTION, SUBROUTINE, or ENTRY 
   statement that precedes the executable statement."

 * * *

Regarding resolve_variable: As cs_base == NULL, the existing check

5086      /* Deal with forward references to entries during resolve_code, to
5087         satisfy, at least partially, 12.5.2.5.  */
5088      if (gfc_current_ns->entries
5089          && current_entry_id == sym->entry_id
5090          && cs_base

fails and, hence, there is no error.

 * * *

Side remarks:

a) "before the ENTRY statement in which it is a parameter"
-> Misuse of the term "parameter"

b) "warning: ‘master.0.sub’ defined but not used"
-> Declare as DECL_ARTIFICIAL to avoid warning - or to handle it better if the
warning itself makes sense.


  parent reply	other threads:[~2011-09-27 14:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 10:32 [Bug fortran/50525] New: " zeccav at gmail dot com
2011-09-27  8:24 ` [Bug fortran/50525] " burnus at gcc dot gnu.org
2011-09-27 12:44 ` burnus at gcc dot gnu.org
2011-09-27 14:40 ` burnus at gcc dot gnu.org [this message]
2013-06-22 15:34 ` dominiq at lps dot ens.fr
2021-02-27  9:43 ` zeccav at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-50525-4-uub8RgDhlz@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).