public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Chung-Lin Tang <cltang@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	Tobias Burnus <tobias@codesourcery.com>,
	Catherine Moore <clm@codesourcery.com>
Subject: Re: [PATCH, OpenMP] Fix nested use_device_ptr
Date: Fri, 1 Apr 2022 11:07:16 +0200	[thread overview]
Message-ID: <YkbAxFwBSEy2rzof@tucnak> (raw)
In-Reply-To: <75e20d43-2f79-b48d-e297-3c75fa3a49b3@codesourcery.com>

On Fri, Apr 01, 2022 at 05:02:36PM +0800, Chung-Lin Tang wrote:
> this patch fixes a bug in lower_omp_target, where for Fortran arrays,
> the expanded sender assignment is wrongly using the variable in the
> current ctx, instead of the one looked-up outside, which is causing
> use_device_ptr/addr to fail to work when used inside an omp-parallel
> (where the omp child_fn is split away from the original).
> Just a one-character change to fix this.
> 
> The fix is inside omp-low.cc, though because the omp_array_data langhook
> is used only by Fortran, this is essentially Fortran-specific.
> 
> Tested on x86_64-linux + nvptx offloading without regressions.
> This is probably not a regression, but seeking to commit when stage1 opens.
> 
> Thanks,
> Chung-Lin
> 
> 2022-04-01  Chung-Lin Tang  <cltang@codesourcery.com>
> 
> gcc/ChangeLog:
> 
> 	* omp-low.cc (lower_omp_target): Use outer context looked-up 'var' as
> 	argument to lang_hooks.decls.omp_array_data, instead of 'ovar' from
> 	current clause.
> 	
> libgomp/ChangeLog:
> 
> 	* testsuite/libgomp.fortran/use_device_ptr-4.f90: New testcase.

Ok, thanks.

	Jakub


      reply	other threads:[~2022-04-01  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  9:02 Chung-Lin Tang
2022-04-01  9:07 ` Jakub Jelinek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YkbAxFwBSEy2rzof@tucnak \
    --to=jakub@redhat.com \
    --cc=clm@codesourcery.com \
    --cc=cltang@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).