public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/99928] [OpenMP] reduction variable in combined target construct wrongly mapped as firstprivate
Date: Fri, 21 May 2021 19:20:53 +0000	[thread overview]
Message-ID: <bug-99928-4-noR5Dbbwis@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99928-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:b5c1c7a96bc8d7062d2c35675f48131667498182

commit r12-991-gb5c1c7a96bc8d7062d2c35675f48131667498182
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri May 21 21:16:21 2021 +0200

    openmp: Fix up firstprivate+lastprivate clause handling [PR99928]

    The C/C++ clause splitting happens very early during construct parsing,
    but only the FEs later on handle possible instantiations, non-static
    member handling and array section lowering.
    In the OpenMP 5.0/5.1 rules, whether firstprivate is added to combined
    target depends on whether it isn't also mentioned in lastprivate or map
    clauses, but unfortunately I think such checks are much better done only
    when the FEs perform all the above mentioned changes.
    So, this patch arranges for the firstprivate clause to be copied or moved
    to combined target construct (as before), but sets flags on that clause,
    which tell the FE *finish_omp_clauses and the gimplifier it has been added
    only conditionally and let the FEs and gimplifier DTRT for these.

    2021-05-21  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/99928
    gcc/
            * tree.h (OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET): Define.
            * gimplify.c (enum gimplify_omp_var_data): Fix up
            GOVD_MAP_HAS_ATTACHMENTS value, add GOVD_FIRSTPRIVATE_IMPLICIT.
            (omp_lastprivate_for_combined_outer_constructs): If combined target
            has GOVD_FIRSTPRIVATE_IMPLICIT set for the decl, change it to
            GOVD_MAP | GOVD_SEEN.
            (gimplify_scan_omp_clauses): Set GOVD_FIRSTPRIVATE_IMPLICIT for
            firstprivate clauses with OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT.
            (gimplify_adjust_omp_clauses): For firstprivate clauses with
            OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT either clear that bit and
            OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET too, or remove it and
            let it be replaced by implicit map clause.
    gcc/c-family/
            * c-omp.c (c_omp_split_clauses): Set
OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
            on firstprivate clause copy going to target construct, and for
            target simd set also OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET bit.
    gcc/c/
            * c-typeck.c (c_finish_omp_clauses): Move firstprivate clauses with
            OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't
error
            if a decl is mentioned both in map clause and in such firstprivate
            clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
    gcc/cp/
            * semantics.c (finish_omp_clauses): Move firstprivate clauses with
            OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't
error
            if a decl is mentioned both in map clause and in such firstprivate
            clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
    gcc/testsuite/
            * c-c++-common/gomp/pr99928-3.c: Remove all xfails.
            * c-c++-common/gomp/pr99928-15.c: New test.

  parent reply	other threads:[~2021-05-21 19:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06  8:39 [Bug middle-end/99928] New: " burnus at gcc dot gnu.org
2021-04-06  9:20 ` [Bug middle-end/99928] " jakub at gcc dot gnu.org
2021-04-10 17:23 ` burnus at gcc dot gnu.org
2021-05-06 15:59 ` jakub at gcc dot gnu.org
2021-05-06 16:23 ` burnus at gcc dot gnu.org
2021-05-06 16:35 ` jakub at gcc dot gnu.org
2021-05-13 15:16 ` cvs-commit at gcc dot gnu.org
2021-05-13 19:39 ` burnus at gcc dot gnu.org
2021-05-13 20:13 ` jakub at gcc dot gnu.org
2021-05-19  7:30 ` cvs-commit at gcc dot gnu.org
2021-05-20  7:20 ` cvs-commit at gcc dot gnu.org
2021-05-21 19:15 ` cvs-commit at gcc dot gnu.org
2021-05-21 19:20 ` cvs-commit at gcc dot gnu.org [this message]
2021-05-25  9:08 ` cvs-commit at gcc dot gnu.org
2021-05-28  9:34 ` cvs-commit at gcc dot gnu.org
2021-05-29  8:08 ` cvs-commit at gcc dot gnu.org
2021-06-01 10:48 ` cvs-commit at gcc dot gnu.org
2021-06-02  9:48 ` cvs-commit at gcc dot gnu.org
2021-06-04 10:08 ` cvs-commit at gcc dot gnu.org
2021-06-04 10:19 ` cvs-commit at gcc dot gnu.org
2021-06-04 12:04 ` burnus at gcc dot gnu.org
2021-06-08  7:52 ` cvs-commit at gcc dot gnu.org
2023-05-03 17:36 ` anlauf 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-99928-4-noR5Dbbwis@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).