[Patch, Fortran] -fcoarray=lib: Fix vector subscript handling

Tobias Burnus burnus@net-b.de
Wed Dec 17 23:20:00 GMT 2014


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?

* * *

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vec.diff
Type: text/x-patch
Size: 2806 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141217/6216d193/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug.diff
Type: text/x-patch
Size: 5162 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141217/6216d193/attachment-0001.bin>


More information about the Gcc-patches mailing list