public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/90742] OpenACC/OpenMP target offloading: Fortran 'allocatable' scalars in 'firstprivate' clauses
Date: Wed, 09 Jun 2021 08:39:28 +0000	[thread overview]
Message-ID: <bug-90742-4-CDV5DOusjX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-90742-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90742

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org
             Status|WAITING                     |NEW

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Came up in context of my patch for PR92568 (gfortran.dg/gomp/defaultmap-8.f90)
and the following does not work neither for scalars nor for arrays:



integer, allocatable :: a, b(:)
a = 2     ! implicit allocation
b = [2]   ! implicit allocation
!$omp target firstprivate(a,b)
  if (a /= 2 .or. b(1) /= 1) stop 1
  a = 1
  b = 1
!$omp end target

if (a /= 2) stop 2
if (b(1) /= 2) stop 2
end



Namely (for a variant with only the scalar 'a'):

    .omp_data_arr.2.a = a;
    #pragma omp target num_teams(1) thread_limit(0) firstprivate(a) [child fn:
MAIN__._omp_fn.0 (.omp_data_arr.2, .omp_data_sizes.3, .omp_data_kinds.4)]
      {
        .omp_data_i = (const struct .omp_data_t.1 & restrict) &.omp_data_arr.2;
        D.3963 = .omp_data_i->a;
        a = D.3963;
        {
          D.3943 = *a;

       reply	other threads:[~2021-06-09  8:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-90742-4@http.gcc.gnu.org/bugzilla/>
2021-06-09  8:39 ` burnus at gcc dot gnu.org [this message]
2021-06-29 13:50 ` cvs-commit at gcc dot gnu.org
2022-05-23 10:09 ` burnus at gcc dot gnu.org

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=bug-90742-4-CDV5DOusjX@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).