This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40998] New: Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
- From: "toon at moene dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2009 12:52:51 -0000
- Subject: [Bug fortran/40998] New: Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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