This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] -fcoarray=lib: Fix vector subscript handling
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>, Alessandro Fanfarillo <fanfarillo at ing dot uniroma2 dot it>
- Date: Mon, 22 Dec 2014 21:26:51 +0100
- Subject: Re: [Patch, Fortran] -fcoarray=lib: Fix vector subscript handling
- Authentication-results: sourceware.org; auth=none
- References: <54920E4A dot 4030003 at net-b dot de>
2014-12-18 0:14 GMT+01:00 Tobias Burnus <burnus@net-b.de>:
> As testing by Alessandro revealed, vector subscripts weren't properly
> handled.
>
> This patch fixes the compiler side (or at least those issues I found). In
> particular, for expressions ("get") it wrongly passed a NULL pointer,
> additionally, I used the wrong "ar". For it and for assignments/push
> ("send", "sendget"), I also used the wrong rank value as one also passes
> DIMEN_ELEMENT as DIMEN_RANGE.
>
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk?
Ok.
Thanks,
Janus
> * * *
>
> I still have to add vector subscript support to libcaf_single. I didn't
> include an -fdump-tree-original test case, but I can add one if there
> regarded as useful.
>
> Attached is â besides the patch for trans-intrinsic.c â a debuging patch for
> libcaf_single. I tested it with:
> integer :: A(2,3)[*]
> A(2,:) = A(1,[1,3,2])[1]
> end
>
> integer :: A(2,3)[*]
> A(1,[1,3,2])[1] = A(2,:)
> end
>
> integer :: A(2,3)[*]
> integer :: B(2,3)[*]
> A(1,[1,3,2])[1] = B(1,[1,3,2])[1]
> end
>
> The output looks like (for the first one):
>
> DEBUG: CAF_GET: 0x7fffb72f71d0
> DEBUG: have vector for rank 2 [1]
> DEBUG: dim=0: nvec = 0
> DEBUG: (1:1:1)
> DEBUG: dim=1: nvec = 3
> DEBUG: 0: 1
> DEBUG: 1: 3
> DEBUG: 2: 2
>
> Tobias