This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/20774] New: Debug information in .o (from FORTRAN) points to temporary file under certain circumstances


Compiling short subroutine below (with included .inc file) produces defective
debug information referring to temporary file. Pre-processed file not included
because -save-temps option (slightly) changes the nature of the problem, and
compiling the preprocessed .f file will not exhibit the problem.

### begin cblock.inc ###
      REAL X,Y,Z
      COMMON /CBLOCK/ X,Y,Z
### end cblock.inc ###

### begin tsub.F ###
      subroutine tsub
      implicit none

      include 'cblock.inc'

      INTEGER          I2
      REAL             F1

      I2 = 3
      F1 = 1.0

      return
      end
### end tsub.F ###

### begin compile command ###
g77 -fno-automatic -v -g -I. -c tsub.F
### end compile command ###

### begin compiler output ###
g77 -fno-automatic -v -g -I. -c tsub.F
Reading specs from
/afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: ../../gcc-3.4.3/configure --prefix=/tmp/build-gcc-v3_4_3
--disable-shared --with-gnu-ld --with-ld=/tmp/build-gcc-v3_4_3/bin/ld
--with-gnu-as --disable-libgcj --with-as=/tmp/build-gcc-v3_4_3/bin/as
--enable-threads=posix --enable-languages=c,c++,f77,objc
Thread model: posix
gcc version 3.4.3
 /afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/../libexec/gcc/i686-pc-linux-gnu/3.4.3/cc1
-E -traditional-cpp -D_LANGUAGE_FORTRAN -quiet -v -I. -iprefix
/afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/
-isystem /afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/include tsub.F
-mtune=pentiumpro -fno-automatic -fworking-directory -o /tmp/cc0zObeX.f
ignoring nonexistent directory
"/afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/include"
ignoring nonexistent directory
"/afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/include"
ignoring nonexistent directory "/tmp/build-gcc-v3_4_3/include"
ignoring nonexistent directory
"/tmp/build-gcc-v3_4_3/lib/gcc/i686-pc-linux-gnu/3.4.3/include"
ignoring nonexistent directory "/tmp/build-gcc-v3_4_3/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/include
 /usr/local/include
 /usr/include
End of search list.
 /afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/../libexec/gcc/i686-pc-linux-gnu/3.4.3/f771
/tmp/cc0zObeX.f -quiet -dumpbase tsub.F -mtune=pentiumpro -auxbase tsub -g
-version -fno-automatic -I. -o /tmp/ccmwNjKI.s
GNU F77 version 3.4.3 (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /afs/fnal.gov/ups/gcc/v3_4_3/Linux+2.4-2.3.2/bin/as -V -Qy -o tsub.o
/tmp/ccmwNjKI.s
GNU assembler version 2.14 (i686-pc-linux-gnu) using BFD version 2.14 20030612
### end compiler output ###

### begin illustration of bug ###
nm -Aal tsub.o | grep tmp
tsub.o:00000004 b f1.1  /tmp/cc0zObeX.f:9
### end illustration of bug ###

### begin explanation ###
Any symbol which gets debug information referring to a temporary file will
probably be inaccessible in the debugger.

Do *any* of the following things, and the problem goes away:

  1) Remove the -fno-automatic switch

  2) Include contents of cblock.inc in tsub.F

  3) Remove the second of the two declarations in tsub.F (F1)

  4) Replace the intrinsic include directive with #include

Replacing:

INTEGER I2
REAL F1

with

INTEGER I1, I2

or

INTEGER I1
INTEGER I2

preserves the problem (the missing symbol is I2, here).

The non-optimal debugger behavior caused by this problem is the same with
ddd/gdb and with totalview.

This bug is present in gcc v3.4.1 and v3.4.3, but not in v3.3.1.
### end explanation ###

-- 
           Summary: Debug information in .o (from FORTRAN) points to
                    temporary file under certain circumstances
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chissg at comcast dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]