This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, OpenACC] Support C++ "this" in OpenACC directives (PR66053)


On Fri, Aug 31, 2018 at 10:04:07AM -0400, Nathan Sidwell wrote:
> On 08/30/2018 04:27 PM, Jason Merrill wrote:
> 
> > On Thu, Aug 30, 2018 at 3:31 PM, Julian Brown <julian@codesourcery.com> wrote:
> > 
> > > "Apart from parsing, it's necessary to prevent the "cannot take the
> > > address of 'this', which is an rvalue expression" error from appearing
> 
> Breaking a rather fundamental language attribute does not seem wise.
> 
> > Why does referring to this[0:1] require making 'this' addressable?
> > Surely what we're interested in is the value of 'this', not the
> > address.
> Yes, transferring the this pointer is very unlikely to be what the user
> wants -- the object being referred to contains the data.  It might be wise
> to look at the DR's and changes relating to lambdas and this capture.  Those
> changes now make it much harder to simply capture the pointer
> unintentionally.

Yeah, I agree we shouldn't try to make this addressable.
Does OpenACC try to map the base of the array section (rather than what e.g.
OpenMP does, privatize the pointer base instead and assign the pointer the
new value inside of the region)?
Even if it is mapped, can't it be mapped by taking an address of a temporary
initialized from this?

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]