public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do
@ 2011-09-27 14:16 zeccav at gmail dot com
  2012-01-23  7:25 ` [Bug fortran/50536] " kargl at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zeccav at gmail dot com @ 2011-09-27 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50536
           Summary: an input item shall not appear as the do-variable of
                    any io-implied-do
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zeccav@gmail.com


! an input item shall not appear as the do-variable of any io-implied-do
! gfortran should reject this one
! (r178939)
      read *,(l,l=1,2)
      end


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do zeccav at gmail dot com
@ 2012-01-23  7:25 ` kargl at gcc dot gnu.org
  2013-06-20 18:39 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kargl at gcc dot gnu.org @ 2012-01-23  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

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

--- Comment #1 from kargl at gcc dot gnu.org 2012-01-23 05:26:50 UTC ---
I have a patch.  Claim the PR.


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do 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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-20 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-06-20
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Marked as ASSIGNED.


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do 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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kargl at gcc dot gnu.org @ 2013-06-20 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

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

--- Comment #3 from kargl at gcc dot gnu.org ---
Un-assign.


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do zeccav at gmail dot com
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-20 22:25 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present at revision 200266.


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do zeccav at gmail dot com
                   ` (3 preceding siblings ...)
  2013-06-20 22:25 ` dominiq at lps dot ens.fr
@ 2013-07-20 20:23 ` burnus at gcc dot gnu.org
  2013-07-20 20:29 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-20 20:23 UTC (permalink / raw)
  To: gcc-bugs

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 ();


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do zeccav at gmail dot com
                   ` (4 preceding siblings ...)
  2013-07-20 20:23 ` burnus at gcc dot gnu.org
@ 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
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-20 20:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #5)
> +         gfc_error ("In a READ statement, the input item at %L shall not "
> +                    "be the do-variable of any io-implied-do");

Requires for %L: &new_code->where. And it is insufficient as it does not take
care of, e.g.
   (foo%a(foo%i), foo%i = 1,5)
which is odd but valid.


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do zeccav at gmail dot com
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-21  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
> it is insufficient as it does not take care of, e.g.
>    (foo%a(foo%i), foo%i = 1,5)
> which is odd but valid.

Or the following (for i /= j): (foo(i)%i, foo(j)%i = 1, 5).


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

* [Bug fortran/50536] an input item shall not appear as the do-variable of any io-implied-do
  2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do zeccav at gmail dot com
                   ` (6 preceding siblings ...)
  2013-07-21  9:50 ` burnus at gcc dot gnu.org
@ 2021-02-27  8:53 ` zeccav at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: zeccav at gmail dot com @ 2021-02-27  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Vittorio Zecca <zeccav at gmail dot com> ---
Still present in version 11.

Detected by NAG nagfor and Intel ifort.

[vitti f95]$nagfor -S -w gfbug74.f
NAG Fortran Compiler Release 7.0(Yurakucho) Build 7042
Error: gfbug74.f, line 4: Input item L cannot also be an I/O implied DO
variable
[NAG Fortran Compiler error termination, 1 error]
[vitti f95]$ifort -S -w gfbug74.f
gfbug74.f(4): error #8251: An input item must not appear as the implied-DO
variable of any implied-DO loop that contains the input item.   [L]
      read *,(l,l=1,2) 
--------------^
compilation aborted for gfbug74.f (code 1)

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

end of thread, other threads:[~2021-02-27  8:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 14:16 [Bug fortran/50536] New: an input item shall not appear as the do-variable of any io-implied-do 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
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

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).