public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56007] New: Remarkably bad error message with DO array=1,2
@ 2013-01-16 17:03 tobi at gcc dot gnu.org
  2013-01-16 17:12 ` [Bug fortran/56007] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tobi at gcc dot gnu.org @ 2013-01-16 17:03 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56007
           Summary: Remarkably bad error message with DO array=1,2
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tobi@gcc.gnu.org


$ cat t3.f90
real iw1(90)
do iw1=1,2
end do
END 
$ gfortran t3.f90
t3.f90:2.6:

do iw1=1,2
      1
Error: Loop variable at (1) cannot be a sub-component
t3.f90:3.3:

end do
   1
Error: Expecting END PROGRAM statement at (1)
$ 

match.c has the following check in gfc_match_iterator:
  if (var->ref != NULL)
    {
      gfc_error ("Loop variable at %C cannot be a sub-component");
      goto cleanup;
    }
This assumes that all ref's are component ref's.  I verified that the bug
happens with 4.7.2, but looking at the code I would assume that this also
happens with the trunk.

This error message was mildly confusing, as I ran into this in a Fortran 77
codebase where there are no components.


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

end of thread, other threads:[~2013-01-22 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-16 17:03 [Bug fortran/56007] New: Remarkably bad error message with DO array=1,2 tobi at gcc dot gnu.org
2013-01-16 17:12 ` [Bug fortran/56007] " dominiq at lps dot ens.fr
2013-01-16 17:40 ` anlauf at gmx dot de
2013-01-22 12:56 ` tobi at gcc dot gnu.org

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