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 c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
Date: Fri, 10 Feb 2023 17:44:52 +0000	[thread overview]
Message-ID: <bug-108180-4-616tDXQahM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108180-4@http.gcc.gnu.org/bugzilla/>

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

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

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

commit r12-9131-gc4b8949a3ad0a2259388841f3c833876a19bd2a2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Dec 21 09:05:27 2022 +0100

    openmp: Don't try to destruct DECL_OMP_PRIVATIZED_MEMBER vars [PR108180]

    DECL_OMP_PRIVATIZED_MEMBER vars are artificial vars with DECL_VALUE_EXPR
    of this->field used just during gimplification and omp lowering/expansion
    to privatize individual fields in methods when needed.
    As the following testcase shows, when not in templates, they were handled
    right, but in templates we actually called cp_finish_decl on them and
    that can result in their destruction, which is obviously undesirable,
    we should only destruct the privatized copies of them created in omp
    lowering.

    Fixed thusly.

    2022-12-21  Jakub Jelinek  <jakub@redhat.com>

            PR c++/108180
            * pt.cc (tsubst_expr): Don't call cp_finish_decl on
            DECL_OMP_PRIVATIZED_MEMBER vars.

            * testsuite/libgomp.c++/pr108180.C: New test.

    (cherry picked from commit 1119902b6c7c1c50123ed85ec1def8be4772d68c)

  parent reply	other threads:[~2023-02-10 17:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 17:41 [Bug c++/108180] New: " info@ebner-markus.de
2022-12-20 11:56 ` [Bug c++/108180] " jakub at gcc dot gnu.org
2022-12-21  8:10 ` cvs-commit at gcc dot gnu.org
2022-12-21  8:27 ` jakub at gcc dot gnu.org
2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org [this message]
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
2023-05-03  9:34 ` jakub at gcc dot gnu.org
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:22 ` jakub 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-108180-4-616tDXQahM@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).