[Bug fortran/23638] New: Print format generates compiler segmentation fault

David dot Webb at soc dot soton dot ac dot uk gcc-bugzilla@gcc.gnu.org
Tue Aug 30 15:10:00 GMT 2005


The following code produces the error message:
  "internal compiler error: Segmentation fault"
  "Please submit a full bug report"

      PROGRAM main
c
c  Simplified extract from legacy code which generated format
c     statements
c
c  Compiled with gfortran 4.0.1:
c     Using built-in specs.
c     Target: i586-pc-linux-gnu
c     Configured with: ../gcc-4.0.1/configure --program-suffix=4
c     --with-gnu-as --with-gnu-ld
c     --enable-version-specific-runtime-libs --with-cpu=k6
c     Thread model: posix
c     gcc version 4.0.1
c
c
c  - I presume it should work, using array element 1, or give 
c    a sensible error report
c    PRINT AOUT(1), ...  compiles and runs OK
c
      CHARACTER*8 AOUT(2)
c
      DATA AOUT(1),AOUT(2)/"(6X,4I5)","(4I7)"/
c
      PRINT AOUT,1,2,3,4
c
      STOP
      END

This may be related to "Known Causes of Trouble with GNU Fortran"->"Missing
Features"->"Invalid FORMAT Specifiers".  Usually the latter is a run time
problem, this is a complete compiler failure with no error message about the cause.
 
Additional Information
======================

Output from 'f77 -v -save-temps debug.F':  (f77 is my link)

f77 -v -save-temps debug.F
Driving: f77 -v -save-temps debug.F -lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: i586-pc-linux-gnu
Configured with: ../gcc-4.0.1/configure --program-suffix=4 --with-gnu-as
--with-gnu-ld --enable-version-specific-runtime-libs --with-cpu=k6
Thread model: posix
gcc version 4.0.1
 /usr/local/libexec/gcc/i586-pc-linux-gnu/4.0.1/cc1 -E -traditional-cpp
-D_LANGUAGE_FORTRAN -quiet -v debug.F -mtune=k6 -fpch-preprocess -o debug.f
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/i586-pc-linux-gnu/4.0.1/../../../../i586-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc/i586-pc-linux-gnu/4.0.1/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i586-pc-linux-gnu/4.0.1/f951 debug.f -ffixed-form -quiet
-dumpbase debug.F -mtune=k6 -auxbase debug -version -o debug.s
GNU F95 version 4.0.1 (i586-pc-linux-gnu)
        compiled by GNU C version 4.0.1.
GGC heuristics: --param ggc-min-expand=55 --param ggc-min-heapsize=48298
debug.F: In function ‘MAIN__’:
debug.F:23: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Contents of debug.s

        .file   "debug.f"

Contents of debug.f

# 1 "debug.F"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "debug.F"
      PROGRAM main
c
c  Simplified extract from legacy code which generated format
c     statements
c
c  Compiled with gfortran 4.0.1:
c     Using built-in specs.
c     Target: i586-pc-1-gnu
c     Configured with: ../gcc-4.0.1/configure --program-suffix=4
c     --with-gnu-as --with-gnu-ld
c     --enable-version-specific-runtime-libs --with-cpu=k6
c     Thread model: posix
c     gcc version 4.0.1
c
c
c  - I presume it should work or give a sensible error report
c  PRINT AOUT(1), ...  compiles and runs OK
c
      CHARACTER*8 AOUT(2)
c
      DATA AOUT(1),AOUT(2)/"(6X,4I5)","(4I7)"/
c
      PRINT AOUT,1,2,3,4
c
      STOP
      END

-- 
           Summary: Print format generates compiler segmentation fault
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: David dot Webb at soc dot soton dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list