ICE caused by -O3 and fbounds-check options together

Vivek Rao vivekrao4@yahoo.com
Thu Oct 12 22:18:00 GMT 2006


The program below causes an ICE if compiled with
-fbounds-check and the -O3 option, but not if -O2 or
-O1 are used instead of -O3.

! gfortran gcc version 4.2.0 20061011 (experimental)
on Windows XP
! compiles   with gfortran -c -O3
! compiles   with gfortran -c -fbounds-check
! causes ICE with gfortran -c -O3 -fbounds-check
! error message:
! cov_test.f90: In function 'abc':
! cov_test.f90:8: internal compiler error: in
compare_name_with_value, at tree-vrp.c:3561
module abc_mod
implicit none
integer, public, parameter :: dp = kind(1.0d0)
private
public :: abc
contains
pure function abc(xsd) result(res)
real(kind=dp), intent(in) :: xsd(:)
real(kind=dp)             :: res(size(xsd),size(xsd))
integer                   :: i,j,n
n = size(xsd)
do i=1,n
   do j=1,n
      if (i /= j) then
         res(i,j) = 0.0_dp
      else
         res(i,j) = xsd(i)*xsd(j)
      end if
   end do
end do
end function abc
end module abc_mod

Vivek Rao



More information about the Fortran mailing list