* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
@ 2021-05-15 12:51 ` nilsgladitz at gmail dot com
2021-05-23 9:01 ` jehelset at gmail dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: nilsgladitz at gmail dot com @ 2021-05-15 12:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
--- Comment #1 from Nils Gladitz <nilsgladitz at gmail dot com> ---
(In reply to Nils Gladitz from comment #0)
> Indicating that "Foo" is constructed more often than it gets destructed.
Sorry that of course was supposed to read:
Indicating that "Foo" is destructed more often than it gets constructed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
2021-05-15 12:51 ` [Bug c++/100611] " nilsgladitz at gmail dot com
@ 2021-05-23 9:01 ` jehelset at gmail dot com
2021-06-10 14:15 ` davidledger at live dot com.au
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jehelset at gmail dot com @ 2021-05-23 9:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
John Eivind Helset <jehelset at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jehelset at gmail dot com
--- Comment #2 from John Eivind Helset <jehelset at gmail dot com> ---
Maybe related: https://godbolt.org/z/vsc8MYTcn
In my case it seemed like co_awaiting expressions that involved
compiler-generator constructors binding references to pr-values was
problematic, or something along these lines.
Was a problem on 11.1. Couldn't reproduce on 10.2.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
2021-05-15 12:51 ` [Bug c++/100611] " nilsgladitz at gmail dot com
2021-05-23 9:01 ` jehelset at gmail dot com
@ 2021-06-10 14:15 ` davidledger at live dot com.au
2021-08-09 0:41 ` davidledger at live dot com.au
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: davidledger at live dot com.au @ 2021-06-10 14:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
David Ledger <davidledger at live dot com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |davidledger at live dot com.au
--- Comment #3 from David Ledger <davidledger at live dot com.au> ---
Ah, yeah this seems to be the same:
https://godbolt.org/z/8r8oGG4z5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (2 preceding siblings ...)
2021-06-10 14:15 ` davidledger at live dot com.au
@ 2021-08-09 0:41 ` davidledger at live dot com.au
2021-10-01 20:14 ` iains at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: davidledger at live dot com.au @ 2021-08-09 0:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
--- Comment #4 from David Ledger <davidledger at live dot com.au> ---
It still seems like a bug though.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (3 preceding siblings ...)
2021-08-09 0:41 ` davidledger at live dot com.au
@ 2021-10-01 20:14 ` iains at gcc dot gnu.org
2021-10-01 20:37 ` iains at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: iains at gcc dot gnu.org @ 2021-10-01 20:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2021-10-01
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (4 preceding siblings ...)
2021-10-01 20:14 ` iains at gcc dot gnu.org
@ 2021-10-01 20:37 ` iains at gcc dot gnu.org
2022-12-04 10:41 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: iains at gcc dot gnu.org @ 2021-10-01 20:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |victor.burckel at gmail dot com
--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
*** Bug 101243 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (5 preceding siblings ...)
2021-10-01 20:37 ` iains at gcc dot gnu.org
@ 2022-12-04 10:41 ` cvs-commit at gcc dot gnu.org
2024-04-04 19:25 ` vipcxj at 126 dot com
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-04 10:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:
https://gcc.gnu.org/g:58a7b1e354530d8dfe7d8fb859c8b8b5a9140f1f
commit r13-4479-g58a7b1e354530d8dfe7d8fb859c8b8b5a9140f1f
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Wed Nov 30 17:05:56 2022 +0000
coroutines: Do not promote temporaries that will be elided.
We usually need to 'promote' (i.e. save to the coroutine frame) any
temporary
variable that is in a target expression that must persist across an await
expression. However, if the TE is just used as a direct initializer for
another object it will be elided - and we should not promote it since that
would lead to a DTOR call for something that is never constructed.
Since we now have a mechanism to tell if TEs will be elided, use that.
Although the PRs referenced initially appear to be different issues, they
all
stem from this.
Co-Authored-By: Adrian Perl <adrian.perl@web.de>
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/100611
PR c++/101367
PR c++/101976
PR c++/99576
gcc/cp/ChangeLog:
* coroutines.cc (find_interesting_subtree): Do not promote
temporaries
that are only used as direct initializers for some other object.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/pr100611.C: New test.
* g++.dg/coroutines/pr101367.C: New test.
* g++.dg/coroutines/pr101976.C: New test.
* g++.dg/coroutines/pr99576_1.C: New test.
* g++.dg/coroutines/pr99576_2.C: New test.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (6 preceding siblings ...)
2022-12-04 10:41 ` cvs-commit at gcc dot gnu.org
@ 2024-04-04 19:25 ` vipcxj at 126 dot com
2024-04-04 19:39 ` avi at scylladb dot com
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: vipcxj at 126 dot com @ 2024-04-04 19:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
vipcxj at 126 dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vipcxj at 126 dot com
--- Comment #7 from vipcxj at 126 dot com ---
Today I got an account here to report a bug, and realized that the bug was
reported 3 years ago. The version of gcc I'm using is 12.3.0, and it looks like
this bug hasn't been fixed in 3 years~
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (7 preceding siblings ...)
2024-04-04 19:25 ` vipcxj at 126 dot com
@ 2024-04-04 19:39 ` avi at scylladb dot com
2024-04-04 19:40 ` avi at scylladb dot com
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: avi at scylladb dot com @ 2024-04-04 19:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
--- Comment #8 from Avi Kivity <avi at scylladb dot com> ---
Congratulations on getting the account!
The bug is fixed though.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (8 preceding siblings ...)
2024-04-04 19:39 ` avi at scylladb dot com
@ 2024-04-04 19:40 ` avi at scylladb dot com
2024-05-23 4:23 ` vipcxj at 126 dot com
2024-05-23 10:58 ` redi at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: avi at scylladb dot com @ 2024-04-04 19:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
--- Comment #9 from Avi Kivity <avi at scylladb dot com> ---
At least, on 13.2.1. Maybe a backport is required.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (9 preceding siblings ...)
2024-04-04 19:40 ` avi at scylladb dot com
@ 2024-05-23 4:23 ` vipcxj at 126 dot com
2024-05-23 10:58 ` redi at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: vipcxj at 126 dot com @ 2024-05-23 4:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
--- Comment #10 from vipcxj at 126 dot com ---
The gcc version in build-essential for ubuntu22 is 11.4. The latest gcc in
ubuntu22 is 12.3. The latest gcc in ppa:ubuntu-toolchain-r/test is 13.1. To use
gcc 13.2.1, we have to compile it from source~
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object
2021-05-15 12:28 [Bug c++/100611] New: coroutines: destructor called too many times for coroutine lambda stored object nilsgladitz at gmail dot com
` (10 preceding siblings ...)
2024-05-23 4:23 ` vipcxj at 126 dot com
@ 2024-05-23 10:58 ` redi at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2024-05-23 10:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611
--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The fix is in 13.1
^ permalink raw reply [flat|nested] 13+ messages in thread