From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F27233887F6D; Fri, 10 Feb 2023 17:44:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F27233887F6D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676051092; bh=BZfcU+Qg4TZY8SfTiii/F7tDYL5uz8/gdabNIEl3Lkk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MHSOHcraTWsObHce1gjN4S1099rEHgm62yz5kqblSaVcYLfH10+/7nz75AL9yiTJp V2ZYlz6URPztcI0VfHVCLD61bp2dXOKfPVhywsBw1E4rKeJTiiDv96jyJARLwbLnUx gBFmlaD4V590Nh8iFS5oHVfexz4KxzPvPVa3bSXI= 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: Fri, 10 Feb 2023 17:44:52 +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 #4 from CVS Commits --- The releases/gcc-12 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:c4b8949a3ad0a2259388841f3c833876a19bd2a2 commit r12-9131-gc4b8949a3ad0a2259388841f3c833876a19bd2a2 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.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)=