public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/24144] New: segmentation fault in gfortran with character functions.
Date: Fri, 30 Sep 2005 13:03:00 -0000	[thread overview]
Message-ID: <20050930130245.24144.manz@intes.de> (raw)


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


             reply	other threads:[~2005-09-30 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-30 13:03 gcc-bugzilla at gcc dot gnu dot org [this message]
2005-09-30 13:06 ` [Bug fortran/24144] " pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050930130245.24144.manz@intes.de \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).