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

* [Bug fortran/40998] Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
  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 ` burnus at gcc dot gnu dot org
  2009-08-07 14:24 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-08-07 13:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2009-08-07 13:57 -------
I think there is a general GCC 4.5 problem with debugging symbols. I opened a
PR about this (PR 40660) - which is regarding Fortran - but there was recently
also GCC complaining at #gcc about this issue when debugging GCC itself, which
uses as we all know C.


-- 


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


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

* [Bug fortran/40998] Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-08-07 14:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2009-08-07 14:23 -------
Hmm, actually your example works here:

(gdb) b 7
Breakpoint 1 at 0x4007a0: file hjff.f90, line 7.
(gdb) run
[...]
Breakpoint 1, dummy () at hjff.f90:7
7                 PRINT *, 'Hello',nerr
(gdb) p nerr
$1 = 666

That's with GCC 4.5.0 20090805 and 6.8.50.20090803-10.1 (openSUSE's version,
which contains patches from Fedora/Jan Kratochvil). I do have the problem
mentioned in PR 40660 comment 2 that the same line appears several times.


-- 


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


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

* [Bug fortran/40998] Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-08-07 14:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2009-08-07 14:32 -------
The result of eu-readelf looks OK, however, since I read "module" for item 175,
I wonder whether this is a problem that gdb is too old. There was a change (I
think in the later stages of 4.4.0) which wrote the proper DWARF_MODULE* to the
ELF binary. However, gdb did ignore that bit. There was a fix for the gdb trunk
which allows to handle those DWARF_MODULEs in some way. (The patches on the
Fedora branch added the proper handling of module variables.)

I am not sure whether this is the real problem since "nerr" is not a module
variable but a local variable of a module procedure, but I wonder whether
nevertheless this could be the problem.


 [   175]    module
             decl_line            1
 [   180]      subprogram
               external
               name                 "dummy"
               decl_line            4
 [   19c]        variable
                 name                 "nerr"

The Fedora branch can be found at
http://sourceware.org/git/?p=archer.git;a=summary and the patches also support
Fortran 95 style arrays (i.e. those using an array descriptor).


-- 


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


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

* [Bug fortran/40998] Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
  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
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-08-07 16:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2009-08-07 16:00 -------
> There was a change (I think in the later stages of 4.4.0) which wrote the proper 
> DWARF_MODULE* to the ELF binary. However, gdb did ignore that bit.
> There was a fix for the gdb trunk

See: http://sourceware.org/bugzilla/show_bug.cgi?id=9806  (and PR 39073)


-- 


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


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

* [Bug fortran/40998] Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
  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
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: toon at moene dot org @ 2009-08-07 16:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from toon at moene dot org  2009-08-07 16:58 -------
Could indeed be the version of gdb.

Mine is:

$ gdb -v
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".

which seems to be a bog standard 6.8 gdb (from 2008).

So perhaps it's not gfortran's fault, but a short-coming in not totally
up-to-date gdb's ....

Thanks,


-- 


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


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

* [Bug fortran/40998] Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
  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
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-12-04 23:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dfranke at gcc dot gnu dot org  2009-12-04 23:42 -------
(In reply to comment #5)
> So perhaps it's not gfortran's fault, but a short-coming in not totally
> up-to-date gdb's ....

Any news here?


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug fortran/40998] Source with routine in CONTAINS section and a local variable: No symbol "nerr" in current context
  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
                   ` (5 preceding siblings ...)
  2009-12-04 23:43 ` dfranke at gcc dot gnu dot org
@ 2010-03-20  9:40 ` toon at moene dot org
  6 siblings, 0 replies; 8+ messages in thread
From: toon at moene dot org @ 2010-03-20  9:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from toon at moene dot org  2010-03-20 09:39 -------
Works when using Debian's version of gfortran 4.4.3 and their gdb (version
7.0.1).


-- 

toon at moene dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WORKSFORME


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