public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Julian Brown <julian@codesourcery.com>
Cc: <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>,
	<fortran@gcc.gnu.org>
Subject: Re: [PATCH 1/2] OpenMP/Fortran: Combined directives with map/firstprivate of same symbol
Date: Thu, 8 Dec 2022 11:22:09 +0100	[thread overview]
Message-ID: <55d31032-a0aa-0411-157e-deba6fe132f9@codesourcery.com> (raw)
In-Reply-To: <20221207190903.78a6b37f@squid.athome>

On 07.12.22 20:09, Julian Brown wrote:
> On Wed, 26 Oct 2022 12:39:39 +0200
> Tobias Burnus <tobias@codesourcery.com> wrote:
>> The ICE seems to be because gcc/fortran/trans-openmp.cc's
>> gfc_split_omp_clauses mishandles this as the dump shows the following:
>>
>>     #pragma omp target firstprivate(a) map(tofrom:a)
>>           #pragma omp parallel firstprivate(a)
>>
>> In contrast, for the C testcase:
>>
>> #pragma omp target parallel for simd map(x) firstprivate(x)
>>
>> the dump is as follows, which seems to be sensible:
>>
>>     #pragma omp target map(tofrom:x)
>>           #pragma omp parallel firstprivate(x)
> This patch fixes a case where a combined directive (e.g. "!$omp target
> parallel ...") contains both a map and a firstprivate clause for the
> same variable.  When the combined directive is split into two nested
> directives, the outer "target" gets the "map" clause, and the inner
> "parallel" gets the "firstprivate" clause, like so:
...
> This is not a recent regression, but appears to fix a long-standing ICE.
...
> gcc/fortran/
>          * trans-openmp.cc (gfc_add_firstprivate_if_unmapped): New function.
>          (gfc_split_omp_clauses): Call above.
>
> libgomp/
>          * testsuite/libgomp.fortran/combined-directive-splitting-1.f90: New
>          test.

LGTM – thanks!

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

      parent reply	other threads:[~2022-12-08 10:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 16:14 [PATCH] OpenMP: Duplicate checking for map clauses in Fortran (PR107214) Julian Brown
2022-10-26 10:39 ` Tobias Burnus
2022-12-07 19:09   ` [PATCH 1/2] OpenMP/Fortran: Combined directives with map/firstprivate of same symbol Julian Brown
2022-12-07 19:13     ` [PATCH 2/2] OpenMP: Duplicate checking for map clauses in Fortran (PR107214) Julian Brown
2022-12-08 12:04       ` Tobias Burnus
2022-12-10 12:10         ` Julian Brown
2022-12-10 12:48           ` Tobias Burnus
2022-12-08 10:22     ` Tobias Burnus [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=55d31032-a0aa-0411-157e-deba6fe132f9@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=julian@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).