This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [Patch, Fortran] SELECT TYPE with associate-name


On 10/05/2009 02:06 PM, Janus Weil wrote:
> here is a patch that implements a small enhancement for the SELECT
> TYPE construct, namely using an associate-name, as in:
> SELECT TYPE ( x => ... )
>   
While your test case works for me (w/ gfortran, NAG f95, ifort), the
following program - which compiles & runs with NAG f95 v5.1 and ifort -
causes an ICE with your patch:

==21989== Invalid read of size 4
==21989==    at 0x53AA61: gfc_conv_scalarized_array_ref (trans-array.c:2489)
==21989==    by 0x53B164: gfc_conv_array_ref (trans-array.c:2539)
==21989==    by 0x33: ???
==21989==  Address 0x188 is not stack'd, malloc'd or (recently) free'd
hjaf.f90: In function 'MAIN__':
hjaf.f90:11:0: internal compiler error: Segmentation fault


implicit none
type t0
  integer :: j = 42
end type t0
type t
  integer :: i
  class(t0), allocatable :: foo(:)
end type t
type(t) :: m
allocate(t0 :: m%foo(3))
m%i = 5
select type(bar => m%foo)
type is(t0)
  print *, bar
end select
end


Tobias


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