Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-12 Thread Jakub Jelinek
On Tue, Sep 11, 2018 at 10:20:26PM -0400, Julian Brown wrote: > 2018-09-09 Cesar Philippidis > Julian Brown > > PR middle-end/86336 > > gcc/cp/ > * semantics.c (finish_omp_clauses): Treat C++ references the same in > OpenACC as OpenMP. > >

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-11 Thread Julian Brown
On Mon, 10 Sep 2018 20:31:49 -0400 Julian Brown wrote: > [...] I think the handling of references can and should match between > the two APIs (though implementation details of the patch to make that > so need a little work still). Here's a new version of the patch, somewhat simplified and slight

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-11 Thread Jakub Jelinek
On Mon, Sep 10, 2018 at 08:31:49PM -0400, Julian Brown wrote: > #pragma omp target enter data map(to:arr[0:32]) > > //#pragma omp target // works, mapped as zero-length array section (*) > //#pragma omp target map(tofrom:myptr) // crashes (**) In this case OpenMP doesn't allow the implementation

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-10 Thread Julian Brown
On Mon, 10 Sep 2018 22:22:15 +0100 Jason Merrill wrote: > On Mon, Sep 10, 2018 at 7:07 PM, Julian Brown > wrote: > > I think it's more accurate to say that OpenACC says nothing about > > C++ references at all, nor about how unadorned pointers are mapped > > in copy/copyin/copyout clauses. So arg

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-10 Thread Jakub Jelinek
On Mon, Sep 10, 2018 at 10:22:15PM +0100, Jason Merrill wrote: > > As noted in a previous email, PGI seems to treat pointers to > > aggregates specially, mapping them as ptr[0:1], but it's unclear if the > > same is true for pointers to scalars with their compiler. Neither > > behaviour seems to be

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-10 Thread Jason Merrill
On Mon, Sep 10, 2018 at 7:07 PM, Julian Brown wrote: > On Mon, 10 Sep 2018 10:52:47 -0700 > Cesar Philippidis wrote: > >> On 09/10/2018 10:37 AM, Jason Merrill wrote: >> > On Mon, Sep 10, 2018 at 4:05 AM, Julian Brown >> > wrote: >> >> This patch (by Cesar) changes the way C++ references are map

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-10 Thread Julian Brown
On Mon, 10 Sep 2018 10:52:47 -0700 Cesar Philippidis wrote: > On 09/10/2018 10:37 AM, Jason Merrill wrote: > > On Mon, Sep 10, 2018 at 4:05 AM, Julian Brown > > wrote: > >> This patch (by Cesar) changes the way C++ references are mapped in > >> OpenACC regions, fixing an ICE in the non-scalar-

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-10 Thread Cesar Philippidis
On 09/10/2018 10:37 AM, Jason Merrill wrote: > On Mon, Sep 10, 2018 at 4:05 AM, Julian Brown wrote: >> This patch (by Cesar) changes the way C++ references are mapped in >> OpenACC regions, fixing an ICE in the non-scalar-data.C testcase. >> >> Post-patch, references are mapped like this (from the

Re: [PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-10 Thread Jason Merrill
On Mon, Sep 10, 2018 at 4:05 AM, Julian Brown wrote: > This patch (by Cesar) changes the way C++ references are mapped in > OpenACC regions, fixing an ICE in the non-scalar-data.C testcase. > > Post-patch, references are mapped like this (from the omplower dump): > > map(force_present:*x [len: 4])

[PATCH, OpenACC] C++ reference mapping (PR middle-end/86336)

2018-09-09 Thread Julian Brown
This patch (by Cesar) changes the way C++ references are mapped in OpenACC regions, fixing an ICE in the non-scalar-data.C testcase. Post-patch, references are mapped like this (from the omplower dump): map(force_present:*x [len: 4]) map(firstprivate ref:x [pointer assign, bias: 0]) Tested with