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 middle-end/103416] [12 Regression][OpenMP] Bogus firstprivate(n) map(to:n [len: 4][implicit])
Date: Thu, 25 Nov 2021 11:21:22 +0000	[thread overview]
Message-ID: <bug-103416-4-sC7FWWDKbK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103416-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Created attachment 51872
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51872&action=edit
RFC Patch to avoid the pointless evaluation, see comment 4

(In reply to Tobias Burnus from comment #3)

> * Why is the var generated in the parent scope of 'omp target' instead of
> inside 'omp target'?

The problem is a forced evaluation of the array bounds, which I regard as
pointless if the variable is just a plain variable - no array ref, not struct
ref no ...

Cf. attachment. (The question is when 'force=true' is needed and whether the
DECL_P check is the right one or whether more or less should be permitted.)

This is indeed the same as issue as PR80330 (8...)

 * * *

The
  libgomp: cuCtxSynchronize error: misaligned address
is a regression – see comment 1 for a patch which fixes it. This is PR90030
(9...)


 * * *

> * Why is 'map(to:' and not 'firstprivate' used?

Because of:

gfc_omp_predetermined_mapping (tree decl)
{
  if (DECL_ARTIFICIAL (decl)
      && ! GFC_DECL_RESULT (decl)
      && ! (DECL_LANG_SPECIFIC (decl)
            && GFC_DECL_SAVED_DESCRIPTOR (decl)))
    return OMP_CLAUSE_DEFAULTMAP_TO;

I wonder whether OMP_DEFAULTMAP_FIRSTPRIVATE  wouldn't make more sense in this
case – at least for gfc_omp_scalar_target_p ?

Which is also related to PR80330 (8...)

  parent reply	other threads:[~2021-11-25 11:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 18:41 [Bug middle-end/103416] New: " burnus at gcc dot gnu.org
2021-11-24 19:05 ` [Bug middle-end/103416] " cltang at gcc dot gnu.org
2021-11-25  7:18 ` rguenth at gcc dot gnu.org
2021-11-25 10:07 ` burnus at gcc dot gnu.org
2021-11-25 10:52 ` burnus at gcc dot gnu.org
2021-11-25 11:21 ` burnus at gcc dot gnu.org [this message]
2021-11-25 11:24 ` burnus at gcc dot gnu.org
2021-12-02 11:07 ` [Bug middle-end/103416] [OpenMP] Double mapping via " burnus at gcc dot gnu.org
2022-05-06  8:32 ` [Bug fortran/103416] [OpenMP] Double mapping via firstprivate(n) map(to:n [len: 4][implicit]) of loop bounds jakub at gcc dot gnu.org
2023-05-08 12:23 ` rguenth 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-103416-4-sC7FWWDKbK@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).