This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-20000511 i686-pc-linux-gnu g77 crash on -funroll-loops


The attached reduced version of a subroutine from LAPACK-3.0 provokes a 
compiler crash with -funroll-loops, although it appears that no unrolling 
should be done.  Other cases can be shown where this option does not unroll, 
but produces wrong results.

g77 version 2.96 20000511 (experimental) (from FSF-g77 version 0.5.25 
20000511 (experimental))
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 20000511 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.96/f771 sgbconur.f -quiet 
-dumpbase sgbconur.f -O -version -fversion -funroll-loops -o - |
 as -V -Qy -o sgbconur.o -
GNU F77 version 2.96 20000511 (experimental) (i686-pc-linux-gnu) compiled by 
GNU C version 2.96 20000511 (experimental).
GNU Fortran Front End version 0.5.25 20000511 (experimental)
g77: Internal compiler error: program f771 got fatal signal 11
GNU assembler version 2.9.1 (i386-linux), using BFD version 2.9.1.0.21

Tim
tprince@computer.org
      subroutine sgbcon(norm,n,kl,ku,ab,ldab,ipiv,anorm,rcond,work,iwork
     &,info)
C
C  -- LAPACK routine (version 3.0) --
C     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
C     Courant Institute, Argonne National Lab, and Rice University
C     September 30, 1994
C
C     .. Scalar Arguments ..
      character norm
      integer info,kl,ku,ldab,n
      real anorm,rcond
C     ..
C     .. Array Arguments ..
      integer ipiv(n),iwork(n)
      real ab(ldab,n),work(n)
C     ..
C
C  Purpose
C  =======
C demonstrate g77 bug at -O -funroll-loops
C  =====================================================================
C
C     .. Parameters ..
      real one,zero
      parameter(one= 1.0e+0,zero= 0.0e+0)
C     ..
C     .. Local Scalars ..
      logical lnoti,onenrm
      character normin
      integer ix,j,jp,kase,kase1,kd,lm
      real ainvnm,scale,smlnum,t
C     ..
C     .. External Functions ..
      logical lsame
      integer isamax
      real sdot,slamch
      externallsame,isamax,sdot,slamch
C     ..
C     .. External Subroutines ..
      externalsaxpy,slacon,slatbs,srscl,xerbla
C     ..
C     .. Executable Statements ..
C
C           Multiply by inv(L).
C
      do j= 1,n-1
C the following min() intrinsic provokes this bug
	  lm= min(kl,n-j)
	  jp= ipiv(j)
	  t= work(jp)
	  if(jp.ne.j)then
C but only when combined with this if block
	      work(jp)= work(j)
	      work(j)= t
	    endif
C and this subroutine call
	  call saxpy(lm,-t,ab(kd+1,j),1,work(j+1),1)
	enddo
      return
      end

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]