[Bug fortran/33308] New: gfortran 4.2.1 ICE on allocated_array = reshaped_parameter_array + function_returning_array

t_nissie at yahoo dot co dot jp gcc-bugzilla@gcc.gnu.org
Tue Sep 4 21:51:00 GMT 2007


I got ICE on i686-pc-linux-gnu, x86_64-unknown-linux-gnu and
ia64-unknown-linux-gnu with gfortran 4.2.1.

$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.2.1
$ cat reshapetest.f90
! reshapetest.f90 -*-f90-*-
!!
function f()
  implicit none
  real*8 :: f(3,3)
  f(:,:) = 1.0d0
end function f

program reshapetest
  implicit none
  real*8, allocatable :: c(:,:)
  real*8, parameter :: one(3,3) = reshape((/1.0d0, 0.0d0, 0.0d0, &
                                            0.0d0, 1.0d0, 0.0d0, &
                                            0.0d0, 0.0d0, 1.0d0/),(/3,3/))
  interface
     function f()
       implicit none
       real*8 :: f(3,3)
     end function f
  end interface
  allocate(c(3,3))
  c(:,:) = one(:,:) + f()   ! internal compiler error
  write(6,'(3f4.1)') c(:,:)
end program reshapetest
$ gfortran reshapetest.f90
reshapetest.f90: In function 'MAIN__':
reshapetest.f90:21: internal compiler error: in gfc_trans_array_constructor, at
fortran/trans-array.c:1467
   :
$ g95 reshapetest.f90
$ ./a.out
 2.0 1.0 1.0
 1.0 2.0 1.0
 1.0 1.0 2.0


-- 
           Summary: gfortran 4.2.1 ICE on allocated_array =
                    reshaped_parameter_array + function_returning_array
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: t_nissie at yahoo dot co dot jp
 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=33308



More information about the Gcc-bugs mailing list