public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* (g77) internal compiler error: Segmentation fault
@ 2007-05-26  1:02 Roland Winkler
  2007-05-26  1:21 ` Jerry DeLisle
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Winkler @ 2007-05-26  1:02 UTC (permalink / raw)
  To: gcc-bugs

The (shortened) fortran-77 subroutine attached below causes a
segmentation fault of g77 when I execute

$ g77 -O3 -c -funroll-loops  foo.f

No problems occur without optimization.

$ g77 --version
GNU Fortran (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
Copyright (C) 2002 Free Software Foundation, Inc.

(I have SUSE Linux 10.2)

Let me know if you need to know anything else.

Roland



      SUBROUTINE FOO
C
      IMPLICIT NONE
      INTEGER           ngroup, nirred
      PARAMETER        (ngroup = 1, nirred = 24)
      INTEGER           mgroup, melmnt, mirred
      INTEGER           nfull, okanal
      PARAMETER        (nfull  = 3)
      INTEGER           lirred,i, j, k, js, Jsmax (2), lwert, jwert,
     $                  Isubcp (nirred, 2, 0:nfull, 0:1)
      DOUBLE PRECISION  eps, fak1
      DOUBLE COMPLEX    Subcmp (nirred, 2)
      CHARACTER         Csign (2) *1, C_sa (2) *1
      DATA              Csign  / '+', '-' /, C_sa / 's', 'a' /
C     ******************************************************************
      DO mgroup = 1, ngroup
       DO js = 0, 1
        DO lwert = 0, nfull
         jwert = 2 * lwert + js
         DO k = 1, 2
          j = 0
          DO lirred = 1, mirred
           IF (     ABS (DIMAG (Subcmp (lirred,k))) .GT. eps
     $         .OR. ABS (DBLE (i) - fak1) .GT. eps)
     $          WRITE (0, *) 'UG2:', jwert, k, lirred,
     $                            Subcmp (lirred,k)
          END DO
         END DO
        END DO
       END DO
  999  CONTINUE
      END DO
C     ==================================================================
      WRITE (okanal, 1220) (((Csign (j), C_sa (k), jwert, k = 1, 2),
     $                      j = 1, 2), jwert = 0, nfull/2)
 1220 FORMAT (/ 11X, 100 (4 (2A, I1, 1X), 1X))
C
      STOP
      END


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

* Re: (g77) internal compiler error: Segmentation fault
  2007-05-26  1:02 (g77) internal compiler error: Segmentation fault Roland Winkler
@ 2007-05-26  1:21 ` Jerry DeLisle
  2007-05-26  3:17   ` Roland Winkler
  0 siblings, 1 reply; 4+ messages in thread
From: Jerry DeLisle @ 2007-05-26  1:21 UTC (permalink / raw)
  To: Roland Winkler; +Cc: gcc-bugs, Fortran List

Roland Winkler wrote:
> The (shortened) fortran-77 subroutine attached below causes a
> segmentation fault of g77 when I execute
> 
> $ g77 -O3 -c -funroll-loops  foo.f
> 
> No problems occur without optimization.
> 
> $ g77 --version
> GNU Fortran (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
> Copyright (C) 2002 Free Software Foundation, Inc.
> 
> (I have SUSE Linux 10.2)
> 
> Let me know if you need to know anything else.
> 
G77 is no longer maintained.  The new fortran compiler is gfortran and it 
supports f77 code.  I will test to see if gfortran handles your test case.

Also, please correspond with the gfortran list on this so we fortraners can help 
you here.  There are gfortran binaries available.  Let me know if you need help 
with this.  Also helps to know what hardware platform you are on and what OS you 
are using.

Regards,

Jerry


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

* Re: (g77) internal compiler error: Segmentation fault
  2007-05-26  1:21 ` Jerry DeLisle
@ 2007-05-26  3:17   ` Roland Winkler
  2007-05-26  9:56     ` Tobias Burnus
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Winkler @ 2007-05-26  3:17 UTC (permalink / raw)
  To: Jerry DeLisle; +Cc: gcc-bugs, Fortran List

On Fri May 25 2007 Jerry DeLisle wrote:
> Roland Winkler wrote:
> > The (shortened) fortran-77 subroutine attached below causes a
> > segmentation fault of g77 when I execute
> > 
> > $ g77 -O3 -c -funroll-loops  foo.f
> > 
> > No problems occur without optimization.
> > 
> > $ g77 --version
> > GNU Fortran (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
> > Copyright (C) 2002 Free Software Foundation, Inc.
> > 
> > (I have SUSE Linux 10.2)
> > 
> > Let me know if you need to know anything else.
> > 
> G77 is no longer maintained. The new fortran compiler is gfortran
> and it supports f77 code. I will test to see if gfortran handles
> your test case.

Thanks for the quick response. -- I am using precompiled libraries
for which I do not have the sources (always very annoying!). That
makes switching compilers more difficult.

> Also, please correspond with the gfortran list on this so we
> fortraners can help you here. There are gfortran binaries
> available. Let me know if you need help with this. 

I'll take all this as an incentive to find out to what extent I can
switch to gfortran. Certainly I prefer to use actively maintained
software.

> Also helps to know what hardware platform you are on and what OS
> you are using.

$ uname -a
Linux tfkp07 2.6.18.8-0.1-default #1 SMP Fri Mar 2 13:51:59 UTC 2007
i686 i686 i386 GNU/Linux

> I tried your test case with g77, gfortran 4.1, 4.2, and 4.3 and it
> compiles fine with the options you specified. I wonder if you have
> an installation problem?
> 
> Perhaps try reinstalling g77.

The last time I sent a bug report for g77 was probably 8 or 10 years
ago. It has always served me very well.

> Hmm, I see your g77 is 2002 vintage. I have a 3.4 version. Still,
> I would recommend that you upgrade to a newer compiler, preferably
> gfortran.

I'll try to do that!

Thank you once more,

Roland


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

* Re: (g77) internal compiler error: Segmentation fault
  2007-05-26  3:17   ` Roland Winkler
@ 2007-05-26  9:56     ` Tobias Burnus
  0 siblings, 0 replies; 4+ messages in thread
From: Tobias Burnus @ 2007-05-26  9:56 UTC (permalink / raw)
  To: Roland Winkler; +Cc: Jerry DeLisle, gcc-bugs, Fortran List

Hi,

>> Hmm, I see your g77 is 2002 vintage. I have a 3.4 version. Still,
>> I would recommend that you upgrade to a newer compiler, preferably
>> gfortran.
>>     
> I'll try to do that!
>   
Note that openSUSE 10.2 comes with gfortran 4.1.x thus you can simply
install it via YaST2.

If you want to have newer gfortran packages, you can use the
gcc/gfortran 4.1, 4.2 and 4.3 packages available at
http://software.opensuse.org/download/home:/rguenther/openSUSE_10.2/
(Add this directory as additional software source in YaST2)

The gcc/gfortran 4.1, 4.2 and 4.3 packages can be even installed in
parallel; e.g. gcc41-fortran provides gfortran-4.1. Whereas package
"gcc-fortran" provides simply a link from gfortran to gfortran-4.1.

If you want to be bleeding edge, you can also use the nightly builds at
http://gcc.gnu.org/wiki/GFortranBinaries

Tobias


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

end of thread, other threads:[~2007-05-26  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-26  1:02 (g77) internal compiler error: Segmentation fault Roland Winkler
2007-05-26  1:21 ` Jerry DeLisle
2007-05-26  3:17   ` Roland Winkler
2007-05-26  9:56     ` Tobias Burnus

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).