This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [accaf, fortran, 4/4] Allocatable components support in derived typed coarrays
- From: Andreas Schwab <schwab at suse dot de>
- To: Andre Vehreschild <vehre at gmx dot de>
- Cc: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>, "fortran\@gcc.gnu.org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Damian Rouson <damian at sourceryinstitute dot org>
- Date: Tue, 20 Sep 2016 14:18:46 +0200
- Subject: Re: [accaf, fortran, 4/4] Allocatable components support in derived typed coarrays
- Authentication-results: sourceware.org; auth=none
- References: <CAGkQGiJuhjwQThepLuJ8z525AGKY5Mm6J82VWFR2Ki0yY3We9Q@mail.gmail.com> <20160919154553.46ec6e2e@vepi2>
On Sep 19 2016, Andre Vehreschild <vehre@gmx.de> wrote:
> Index: gcc/testsuite/gfortran.dg/coarray_allocate_7.f08
> ===================================================================
> --- gcc/testsuite/gfortran.dg/coarray_allocate_7.f08 (nicht existent)
> +++ gcc/testsuite/gfortran.dg/coarray_allocate_7.f08 (Arbeitskopie)
> @@ -0,0 +1,27 @@
> +! { dg-do run }
> +! { dg-options "-fcoarray=lib -lcaf_single -fdump-tree-original" }
> +
> +! Contributed by Damian Rouson
> +! Checking whether (de-)registering of coarrays works.
> +
> +program main
> +
> + implicit none
> +
> + type mytype
> + integer, allocatable :: indices(:)
> + end type
> +
> + type(mytype), save :: object[*]
> + integer :: i,me
> +
> + me=this_image() ! me is always 1 here
> + object%indices=[(i,i=1,me)]
> + if ( size(object%indices) /= 1 ) call abort()
> + ! therefore no array is present here and no array test needed.
> + if ( object%indices(1) /= 1 ) call abort()
> +end program
> +
> +! { dg-final { scan-tree-dump-times "_gfortran_caf_register \\(D.\[0-9\]{4}, 1, &\\(\\(struct mytype\\) \\*object\\).indices.token, &\\(\\(struct mytype\\) \\*object\\).indices, 0B, 0B, 0\\);" 2 "original" } }
> +! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister \\(&\\(\\(struct mytype\\) \\*object\\).indices.token, 0B, 0B, 0\\);" 1 "original" } }
> +
FAIL: gfortran.dg/coarray_allocate_7.f08 -O0 scan-tree-dump-times original "_gfortran_caf_register \\(D.[0-9]{4}, 1, &\\(\\(struct mytype\\) \\*object\\).indices.token, &\\(\\(struct mytype\\) \\*object\\).indices, 0B, 0B, 0\\);" 2
PASS: gfortran.dg/coarray_allocate_7.f08 -O0 scan-tree-dump-times original "_gfortran_caf_deregister \\(&\\(\\(struct mytype\\) \\*object\\).indices.token, 0B, 0B, 0\\);" 1
$ grep _gfortran_caf_register coarray_allocate_7.f08.003t.original
_gfortran_caf_register (28, 0, (void * *) &caf_token.0, (void *) &desc.2, 0B, 0B, 0);
_gfortran_caf_register (D.986, 1, &((struct mytype) *object).indices.token, &((struct mytype) *object).indices, 0B, 0B, 0);
_gfortran_caf_register (D.986, 1, &((struct mytype) *object).indices.token, &((struct mytype) *object).indices, 0B, 0B, 0);
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."