public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40998]  New: Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
@ 2009-08-07 12:53 toon at moene dot org
  2009-08-07 13:57 ` [Bug fortran/40998] " burnus at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: toon at moene dot org @ 2009-08-07 12:53 UTC (permalink / raw)
  To: gcc-bugs

The following source, compiled with a recent 4.5 snapshot using -ggdb as the
only compiler option:

    MODULE x04aafe_aux
       IMPLICIT NONE
    CONTAINS
       SUBROUTINE dummy
          INTEGER                      :: nerr
          CALL x04aaf(0,nerr)
          PRINT *, 'Hello',nerr
       END SUBROUTINE dummy
    END MODULE x04aafe_aux
    PROGRAM x04aafe
       USE x04aafe_aux
       CALL x04aaf(1,666)
       CALL dummy
    END PROGRAM x04aafe
    SUBROUTINE X04AAF(IFLAG,NERR)
       INTEGER, INTENT (IN)            :: IFLAG
       INTEGER, INTENT (INOUT)         :: NERR
       INTEGER, SAVE                   :: NERR1
       DATA NERR1/6/
       IF (IFLAG==0) NERR = NERR1
       IF (IFLAG==1) NERR1 = NERR
    END SUBROUTINE X04AAF

gives, after entering gdb ./a.out and setting a break on the PRINT line in
routine DUMMY (line number 7):

Breakpoint 1, __x04aafe_aux_MOD_dummy () at x04aafe.f90:7
7                 PRINT *, 'Hello',nerr
Current language:  auto; currently fortran
(gdb) p nerr
No symbol "nerr" in current context.


-- 
           Summary: Source with routine in CONTAINS section and a local
                    variable: No symbol "nerr" in current context
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: toon at moene dot org


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


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

end of thread, other threads:[~2010-03-20  9:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-07 12:53 [Bug fortran/40998] New: Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context toon at moene dot org
2009-08-07 13:57 ` [Bug fortran/40998] " burnus at gcc dot gnu dot org
2009-08-07 14:24 ` burnus at gcc dot gnu dot org
2009-08-07 14:32 ` burnus at gcc dot gnu dot org
2009-08-07 16:00 ` burnus at gcc dot gnu dot org
2009-08-07 16:58 ` toon at moene dot org
2009-12-04 23:43 ` dfranke at gcc dot gnu dot org
2010-03-20  9:40 ` toon at moene 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).