This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/24144] New: segmentation fault in gfortran with character functions.
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2005 13:03:03 -0000
- Subject: [Bug fortran/24144] New: segmentation fault in gfortran with character functions.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When compiling the given peace of fortran code I will get a segmentation fault.
With g77 there have been no problems on it.
The problem is independent of the used optimization level.
permnew@fs1:~/maint_gcc4/tools> /usr/local/bin/gfortran-4.0 -g -v -save-temps -c test.f
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /scratch/root/gcc-4.0.2/configure --prefix=/usr/local --program-suffix=-4.0
Thread model: posix
gcc version 4.0.2
/usr/local/libexec/gcc/i686-pc-linux-gnu/4.0.2/f951 test.f -ffixed-form -quiet -dumpbase test.f -mtune=pentiumpro -auxbase test -g -version -o test.s
GNU F95 version 4.0.2 (i686-pc-linux-gnu)
compiled by GNU C version 4.0.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
test.f: In function 'qfiopn':
test.f:20: 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.
Environment:
System: Linux fs1 2.6.9-11.ELsmp #1 SMP Fri May 20 18:26:27 EDT 2005 i686 athlon i386 GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /scratch/root/gcc-4.0.2/configure --prefix=/usr/local --program-suffix=-4.0
How-To-Repeat:
SUBROUTINE QFIOPN (TYPE,IDF, I R C)
IMPLICIT NONE
INTEGER, INTENT(IN) :: IDF
INTEGER, INTENT(OUT) :: IRC
CHARACTER*(4), INTENT(IN) :: TYPE
C-----------------------------------------------------------------------
C (C) Copyright INTES GmbH, Stuttgart, Germany SE Apr-1991 1
C!mod--------------------------------------------HM-20-Jun-2005-11:03:46
INTEGER IUNIT,ISTAT
CHARACTER*8 FIGOST,STAT
CHARACTER*12 FIGACC,FIGFOR
CHARACTER*96 FIGNAM
C-----------------------------------------------------------------------
IRC = 0
IF( FIGACC(TYPE,IDF) .NE. 'SEQUENTIAL' )THEN
IRC = 5
CPER FORTRAN open failed
GOTO 999
ENDIF
STAT = FIGOST(TYPE,IDF)
C
C Open the sequential file for work
C
OPEN( UNIT = IUNIT ,
* FILE = FIGNAM(TYPE,IDF) ,
* ACCESS = FIGACC(TYPE,IDF) ,
* STATUS = STAT ,
* FORM = FIGFOR(TYPE,IDF) ,
* ERR = 777 ,
* IOSTAT = ISTAT )
GOTO 999
777 CONTINUE
IRC = 6
999 END
------- Additional Comments From manz at intes dot de 2005-09-30 13:02 -------
Fix:
If I add a temproara variable to store the result of the function call
FIGACC(TYPE,IDF) at the beginning and than use this variable on the 2 locations
wehere its realy used, it works, Also only using the OPEN statement also works.
--
Summary: segmentation fault in gfortran with character functions.
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: manz at intes dot de
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=24144