From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 32EB4385383E; Wed, 3 May 2023 15:20:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32EB4385383E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683127217; bh=eGi6hMsjXgg4O/dlEhu6gFyo56HO1WSgMZN4YCoz8CA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ewzVY1u7/b16MfGQJVr9WP/Q9k8B5mrPwaPs8GycEmYG1gQW+LCOZrVrhggJMAaOl I0NSOq5gyvML+cYY+Vs2j72bFPUsEsHOO1P1DJPPUZchE/48EWXk9QPb1icIm9B8Ab qnyE4wU+85k4s7udyMLrPCxQw2hX4XdwH4dmU3l8= From: "cvs-commit at gcc dot 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: Wed, 03 May 2023 15:20:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108180 --- Comment #7 from CVS Commits --- The releases/gcc-10 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:2a8357535300e9d4d6126d7b3ce4cd951f0eb6aa commit r10-11351-g2a8357535300e9d4d6126d7b3ce4cd951f0eb6aa Author: Jakub Jelinek 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/expansi= on to privatize individual fields in methods when needed. As the following testcase shows, when not in templates, they were handl= ed 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 PR c++/108180 * pt.c (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)=