public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30746]  New: 50th Anniversary Bug - scoping error
@ 2007-02-09 15:18 pault at gcc dot gnu dot org
  2007-02-09 15:19 ` [Bug fortran/30746] " pault at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-02-09 15:18 UTC (permalink / raw)
  To: gcc-bugs

Malcolm Cohen's talk to the BCS 50th anniversary of FORTRAN meeting has this
example:

MODULE m
  REAL :: x(3) = (/ 1.5, 2.5, 3.5 /)
CONTAINS
  SUBROUTINE s
    CALL inner
  CONTAINS
    SUBROUTINE inner
      PRINT *,x(7) ! This is not an error!
    END SUBROUTINE
    FUNCTION x(n)
      x = REAL(n)**n
    END FUNCTION
  END SUBROUTINE
END MODULE
  use m
  call s()
end

to which, gfortran incorrectly returns

      PRINT *,x(7) ! This is not an error!
               1
Warning: Array reference at (1) is out of bounds

unless subroutine inner and function x are interchanged.

Paul


-- 
           Summary: 50th Anniversary Bug - scoping error
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-05-12  6:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09 15:18 [Bug fortran/30746] New: 50th Anniversary Bug - scoping error pault at gcc dot gnu dot org
2007-02-09 15:19 ` [Bug fortran/30746] " pault at gcc dot gnu dot org
2007-02-09 17:07 ` fxcoudert at gcc dot gnu dot org
2007-05-10  8:12 ` [Bug fortran/30746] 50th Anniversary Bug - Forward reference to contained function pault at gcc dot gnu dot org
2007-05-10 11:19 ` pault at gcc dot gnu dot org
2007-05-10 20:11 ` patchapp at dberlin dot org
2007-05-12  6:20 ` pault at gcc dot gnu dot org
2007-05-12  6:22 ` pault at gcc dot gnu dot 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).