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]
Other format: [Raw text]

[Bug fortran/34828] ICE: GNU MP: Cannot reallocate memory for gfortran.dg/parameter_array_init_3.f90



------- 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


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