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/50536] an input item shall not appear as the do-variable of any io-implied-do
Date: Sat, 20 Jul 2013 20:23:00 -0000	[thread overview]
Message-ID: <bug-50536-4-PrS3umbeuW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50536-4@http.gcc.gnu.org/bugzilla/>

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid,
                   |                            |diagnostic, patch
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Simple - and completely untested - patch. I am not quite sure whether nested
io-implied-dos can appear - if they can, the patch would be insufficient.
However, I cannot come up with any nested io-implied-do for READ (which
requires the items to be variables). Hence, the patch is presumably sufficient.

--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -3057,2 +3057,12 @@ match_io_iterator (io_kind k, gfc_code **result)

+  if (k == M_READ)
+    for (new_code = head; new_code; new_code = head->next)
+      if (iter->var->symtree == new_code->expr1->symtree)
+       {
+         gfc_error ("In a READ statement, the input item at %L shall not "
+                    "be the do-variable of any io-implied-do");
+         m = MATCH_ERROR;
+         goto cleanup;
+       }
+
   new_code = gfc_get_code ();


  parent reply	other threads:[~2013-07-20 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 14:16 [Bug fortran/50536] New: " zeccav at gmail dot com
2012-01-23  7:25 ` [Bug fortran/50536] " kargl at gcc dot gnu.org
2013-06-20 18:39 ` dominiq at lps dot ens.fr
2013-06-20 22:18 ` kargl at gcc dot gnu.org
2013-06-20 22:25 ` dominiq at lps dot ens.fr
2013-07-20 20:23 ` burnus at gcc dot gnu.org [this message]
2013-07-20 20:29 ` burnus at gcc dot gnu.org
2013-07-21  9:50 ` burnus at gcc dot gnu.org
2021-02-27  8:53 ` 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-50536-4-PrS3umbeuW@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).