public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/24144] New: segmentation fault in gfortran with character functions.
@ 2005-09-30 13:03 gcc-bugzilla at gcc dot gnu dot org
  2005-09-30 13:06 ` [Bug fortran/24144] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2005-09-30 13:03 UTC (permalink / raw)
  To: gcc-bugs


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


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

* [Bug fortran/24144] segmentation fault in gfortran with character functions.
  2005-09-30 13:03 [Bug fortran/24144] New: segmentation fault in gfortran with character functions gcc-bugzilla at gcc dot gnu dot org
@ 2005-09-30 13:06 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-30 13:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-30 13:06 -------
Confirmed backtrace:
#0  0x080b4e39 in set_string (block=0xbfe37bb8, postblock=0xbfe37bb0, var=Variable "var" is not 
available.
)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/trans-io.c:488
#1  0x080b5638 in gfc_trans_open (code=0x8a5a0e8)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/trans-io.c:684
#2  0x08098517 in gfc_trans_code (code=0x8a5a0e8)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/trans.c:581
#3  0x080a7e4e in gfc_generate_function_code (ns=0x8a58250)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/trans-decl.c:2415


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-30 13:06:07
               date|                            |


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


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

end of thread, other threads:[~2005-09-30 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30 13:03 [Bug fortran/24144] New: segmentation fault in gfortran with character functions gcc-bugzilla at gcc dot gnu dot org
2005-09-30 13:06 ` [Bug fortran/24144] " pinskia at gcc dot gnu 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).