* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor info@ebner-markus.de
@ 2022-12-20 11:56 ` jakub at gcc dot gnu.org
2022-12-21 8:10 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-12-20 11:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108180
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Last reconfirmed| |2022-12-20
Ever confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54130
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54130&action=edit
gcc13-pr108180.patch
Untested fix.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor 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
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-21 8:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108180
--- Comment #2 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:1119902b6c7c1c50123ed85ec1def8be4772d68c
commit r13-4822-g1119902b6c7c1c50123ed85ec1def8be4772d68c
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor 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
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-12-21 8:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108180
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor info@ebner-markus.de
` (2 preceding siblings ...)
2022-12-21 8:27 ` jakub at gcc dot gnu.org
@ 2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-10 17:44 UTC (permalink / raw)
To: gcc-bugs
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)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor info@ebner-markus.de
` (3 preceding siblings ...)
2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
@ 2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
2023-05-03 9:34 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 20:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108180
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:9eed31b91ce73a9499297bf8ef2c2b7ce4c8d79b
commit r11-10693-g9eed31b91ce73a9499297bf8ef2c2b7ce4c8d79b
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.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)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor info@ebner-markus.de
` (4 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-03 9:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108180
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.4 as well.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor info@ebner-markus.de
` (5 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 15:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108180
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:2a8357535300e9d4d6126d7b3ce4cd951f0eb6aa
commit r10-11351-g2a8357535300e9d4d6126d7b3ce4cd951f0eb6aa
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.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)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/108180] [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor
2022-12-19 17:41 [Bug c++/108180] New: [OpenMP] Passing a class member variable to firstprivate() erroneously calls its dtor info@ebner-markus.de
` (6 preceding siblings ...)
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
@ 2023-05-04 7:22 ` jakub at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-04 7:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108180
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.5 too.
^ permalink raw reply [flat|nested] 9+ messages in thread