This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34828] ICE: GNU MP: Cannot reallocate memory for gfortran.dg/parameter_array_init_3.f90
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2008 22:37:11 -0000
- Subject: [Bug fortran/34828] ICE: GNU MP: Cannot reallocate memory for gfortran.dg/parameter_array_init_3.f90
- References: <bug-34828-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from kargl at gcc dot gnu dot org 2008-04-30 22:37 -------
(In reply to comment #15)
> Un-assigning myself. I can see valgrind errors but have been unable to isolate
> the problem.
>
I may have a further piece to the puzzle. It appears that len(HEX1) is not
being properly evaluated to give MSKa1(len(HEX1)) the correct array descriptor.
A modified program shows
program z
call a
call b
call d
end program z
subroutine a
implicit none
integer i
character(8), parameter :: HEX1 = '40490FDB'
integer, parameter :: MSKa1(len(HEX1)) = [(1,i=1,len(HEX1))]
!
! If uncomment either line, then segfault.
!
! integer, parameter :: ARR1(len(HEX1)) = [( MSKa1(i), i=1,len(HEX1) )]
! integer, parameter :: ARR1(8) = [( MSKa1(i), i=1,len(HEX1) )]
print '(A,1x,8(i0,1x))', hex1, mska1
end subroutine a
subroutine b
implicit none
integer i
character(8), parameter :: HEX1 = '40490FDB'
!
! If 8 in MSKa1(8) is len(HEX1), then segfault.
!
integer, parameter :: MSKa1(8) = [(1,i=1,len(HEX1))]
integer, parameter :: ARR1(len(HEX1)) = [( MSKa1(i), i=1,len(HEX1) )]
print '(A,1x,16(i0,1x))', hex1, mska1, arr1
end subroutine b
!
! This works as expected!
!
subroutine d
implicit none
integer i
character(8), parameter :: HEX1 = '40490FDB'
integer, parameter :: MSKa1(8) = [(1,i=1,len(HEX1))]
integer, parameter :: ARR1(8) = [( MSKa1(i), i=1,len(HEX1) )]
print '(A,1x,16(i0,1x))', hex1, mska1, arr1
end subroutine d
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34828