public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/38312] Unexpected STATEMENT FUNCTION statement
Date: Sat, 12 Nov 2011 22:41:00 -0000	[thread overview]
Message-ID: <bug-38312-4-SFgC1SY7YU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-38312-4@http.gcc.gnu.org/bugzilla/>

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #5 from kargl at gcc dot gnu.org 2011-11-12 22:03:49 UTC ---
I've looked at this issue, and I have come to the conclusion
that it should be closed as WONTFIX.  First, an error is 
issued, so one can fix their Fortran code.

Now, for the problem.  The matchers are called from the 
parser according this diagram (parse.c line 1717).

        +---------------------------------------+
        | program  subroutine  function  module |
        +---------------------------------------+
        |                use                    |
        +---------------------------------------+
        |                import                 |
        +---------------------------------------+
        |         |        implicit none        |
        |         +-----------+-----------------+
        |         | parameter |  implicit       |
        |         +-----------+-----------------+
        | format  |           |  derived type   |
        | entry   | parameter |  interface      |
        |         |   data    |  specification  |
        |         |           |  statement func |
        |         +-----------+-----------------+
        |         |   data    |    executable   |
        +---------+-----------+-----------------+
        |                contains               |
        +---------------------------------------+
        |      internal module/subprogram       |
        +---------------------------------------+
        |                end                    |
        +---------------------------------------+

As one can see, a DATA statement and a statement function are
parsed at the same level.  A programmer can use an implied
do-loop within a DATA statement.  Unfortunately, an implied
do-loop is parsed by the same code that parses a regular
do-loop.  It appears that insufficient information is contained
within the parser at the point where the error is issued
to determine that the do-loop is in an executable portion of
the program.


       reply	other threads:[~2011-11-12 22:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-38312-4@http.gcc.gnu.org/bugzilla/>
2011-11-12 22:41 ` kargl at gcc dot gnu.org [this message]
2011-11-12 23:31 ` sgk at troutmask dot apl.washington.edu
2013-05-18  2:52 ` bdavis at gcc dot gnu.org
2008-11-28 20:59 [Bug fortran/38312] New: poor error message jv244 at cam dot ac dot uk
2008-12-11 19:01 ` [Bug fortran/38312] Unexpected STATEMENT FUNCTION statement kargl at gcc dot gnu dot org
2008-12-11 19:03 ` kargl at gcc dot gnu dot org

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-38312-4-SFgC1SY7YU@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).