public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Tobias Burnus <tobias@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, fortran <fortran@gcc.gnu.org>
Subject: Re: [Patch] OpenMP: Fix use_device_{addr,ptr} with in-data-sharing arg
Date: Wed, 4 May 2022 18:38:30 +0200	[thread overview]
Message-ID: <6b8ee54d-efd0-e1c6-98e1-72c47f7deab9@codesourcery.com> (raw)
In-Reply-To: <YnJrmRQpbmmVhJ/1@tucnak>

Hi Jakub,

On 04.05.22 14:03, Jakub Jelinek wrote:
> On Wed, Apr 20, 2022 at 03:19:38PM +0200, Tobias Burnus wrote:
>> --- a/gcc/omp-low.cc
>> +++ b/gcc/omp-low.cc
>> @@ -13656,26 +13656,30 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
>>              new_var = lookup_decl (var, ctx);
>>              new_var = DECL_VALUE_EXPR (new_var);
>>              tree v = new_var;
>> +            tree v2 = var;
>> +            if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_PTR
>> +                || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_ADDR)
>> +              {
>> +                v2 = maybe_lookup_decl_in_outer_ctx (var, ctx);
>> +                if (DECL_HAS_VALUE_EXPR_P (v2))
>> +                  v2 = DECL_VALUE_EXPR (v2);
> I don't understand the above 2 lines, why do you need that?

I think it was intermittently required with some (half-)working patch.
But I concur that it is no longer is needed.

> Otherwise LGTM, so if the 2 lines aren't needed, please also drop the
> {}s around v2 = maybe_lookup_decl_in_outer_ctx (var, ctx); and reindent.
I did so, tested it also on my end and committed it as

r13-116-g3f8c389fe90bf565a6221a46bb7fb745dd4c1510

Thanks for the review!

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  reply	other threads:[~2022-05-04 16:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 13:19 Tobias Burnus
2022-05-04 12:03 ` Jakub Jelinek
2022-05-04 16:38   ` Tobias Burnus [this message]
2022-05-10 12:56 ` [Patch] OpenMP: Fix use_device_{addr, ptr} " Thomas Schwinge

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=6b8ee54d-efd0-e1c6-98e1-72c47f7deab9@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).