GCC Version:
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)

OS:
Linux s24n160 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 i686 i686
i386 GNU/Linux

Command-line
gfortran -c -Wall -Wsurprising  -I../lib.f/ ../lib.f/bomec_func.f95 -o
../lib.f/bomec_func.o

Error message:
../lib.f/bomec_func.f95: In function ‘get_cand’:
../lib.f/bomec_func.f95:5: internal compiler error: in gfc_conv_constant, at
fortran/trans-const.c:348

bomec_func.f95 and omec_globals:
module bomec_func
  use omec_globals
  implicit none
  contains
    function bomec_step(fm,old,new,ncl,ppart,psub)
    implicit none
    integer, intent(IN) :: ppart(:,:)
    real(sng) :: bomec_step,maxgain=0.0
    real(sng),intent(IN) :: fm(:,:)
    integer, intent(IN)  :: old(:,:)
    integer, intent(OUT) :: new(:,:)
    integer :: psub(:,:),lenps,lenew=0
    integer :: ncl,i

    do i=1,ncl
      call get_psub(old(i,:),ppart,psub,lenps)
      call get_cand(fm,old(i,:),maxgain,psub,lenps,new,lenew)
    enddo

    bomec_step = maxgain
    end function bomec_step

    subroutine get_ppart(fm,ppart)
    implicit none
    real(sng), intent(IN) :: fm(:,:)
    real(sng), intent(OUT) :: ppart(:,:)
    integer :: shp(2),i,j,cnt,lenppart,ndim
    shp  = shape(fm)
    ndim = shp(1)
    cnt  = 1
    do i = 1,ndim-1
      do j = i+1,ndim
        if (fm(i,j) .gt. 0.0) then
            ppart(cnt,:) = (/i,j/)
            cnt=cnt+1
        endif
      end do
    end do  
    end subroutine get_ppart

    subroutine get_psub(cl,ppart,psub,lenps)
    integer, intent(IN) :: cl(:),ppart(:,:)
    integer, intent(OUT) :: psub(:,:),lenps
    integer :: npos,i
    npos = size(ppart)/2
    lenps=0
    psub=0
    do i=1,npos
       if (cl(ppart(i,1)) /= cl(ppart(i,2))) then
          lenps=lenps+1
          psub(lenps,:)=ppart(i,:)
       endif
    enddo
    end subroutine get_psub

    subroutine get_cand(fm,cl,maxgain,psub,lenps,new,lenew)
    integer, intent(IN) :: cl(:),psub(:,:),lenps
    integer, intent(INOUT) :: new(:,:),lenew 
    real(sng), intent(IN) :: fm(:,:)
    real(sng), intent(INOUT) :: maxgain
    real(sng) :: gain
    integer  :: i,j,k,ndim=size(cl)
    do i=1,lenps
      gain = 0.0
      do j=1,ndim-1
        do k=j+1,ndim
!          if (cl(j)==psub(i,1) .and. cl(k)==psub(i,2) .or. &
!              cl(j)==psub(i,2) .and. cl(k)==psub(i,1)) gain=gain+fm(j,k)
        end do
      end do  
    enddo
    end subroutine get_cand

end module bomec_func

module omec_globals
  integer, parameter :: dbl=kind(0d0),sng=kind(0.0)
  logical :: done = .false.
end module omec_globals


-- 
           Summary: internal compiler error: in gfc_conv_constant
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hirmic at web dot de
  GCC host triplet: 4.1.2


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

Reply via email to