This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] SELECT TYPE with associate-name
- From: Tobias Burnus <burnus at net-b dot de>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, salvatore dot filippone at uniroma2 dot it
- Date: Mon, 05 Oct 2009 15:52:16 +0200
- Subject: Re: [Patch, Fortran] SELECT TYPE with associate-name
- References: <854832d40910050506x7c58c1e1y29788d5574e606f6@mail.gmail.com>
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