* [Bug c++/91217] [8/9/10/11 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
@ 2021-04-02 21:46 ` jason at gcc dot gnu.org
2021-04-03 5:54 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-02 21:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |jason at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/91217] [8/9/10/11 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
2021-04-02 21:46 ` [Bug c++/91217] [8/9/10/11 Regression] Returning std::array from lambda results in an extra copy step on return jason at gcc dot gnu.org
@ 2021-04-03 5:54 ` cvs-commit at gcc dot gnu.org
2021-04-03 14:47 ` [Bug c++/91217] [8/9/10 " jason at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-03 5:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:04771106cda8dca2c8b975fd4648933679455b8f
commit r11-7967-g04771106cda8dca2c8b975fd4648933679455b8f
Author: Jason Merrill <jason@redhat.com>
Date: Sat Apr 3 01:07:36 2021 -0400
c++: NRV in lambda in template [PR91217]
tsubst_lambda_expr was producing a function with two blocks that claimed to
be the outermost block in the function body, one from the call to
start_lambda_function in tsubst_lambda_expr, and one from tsubsting the
block added by start_lambda_function when we first parsed the lambda. This
messed with the named return value optimization, which only works for
variables in the outermost block.
gcc/cp/ChangeLog:
PR c++/91217
* pt.c (tsubst_lambda_expr): Skip the body block from
DECL_SAVED_TREE.
gcc/testsuite/ChangeLog:
PR c++/91217
* g++.dg/opt/nrv20.C: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/91217] [8/9/10 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
2021-04-02 21:46 ` [Bug c++/91217] [8/9/10/11 Regression] Returning std::array from lambda results in an extra copy step on return jason at gcc dot gnu.org
2021-04-03 5:54 ` cvs-commit at gcc dot gnu.org
@ 2021-04-03 14:47 ` jason at gcc dot gnu.org
2021-05-14 9:51 ` [Bug c++/91217] [9/10 " jakub at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-03 14:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9/10/11 Regression] |[8/9/10 Regression]
|Returning std::array from |Returning std::array from
|lambda results in an extra |lambda results in an extra
|copy step on return |copy step on return
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for GCC 11 so far.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/91217] [9/10 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2021-04-03 14:47 ` [Bug c++/91217] [8/9/10 " jason at gcc dot gnu.org
@ 2021-05-14 9:51 ` jakub at gcc dot gnu.org
2021-05-20 21:34 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14 9:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|8.5 |9.4
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/91217] [9/10 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2021-05-14 9:51 ` [Bug c++/91217] [9/10 " jakub at gcc dot gnu.org
@ 2021-05-20 21:34 ` cvs-commit at gcc dot gnu.org
2021-06-01 8:14 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-20 21:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:a12ae580e13f5856983142a0234651d8e8aad599
commit r10-9841-ga12ae580e13f5856983142a0234651d8e8aad599
Author: Jason Merrill <jason@redhat.com>
Date: Sat Apr 3 01:07:36 2021 -0400
c++: NRV in lambda in template [PR91217]
tsubst_lambda_expr was producing a function with two blocks that claimed to
be the outermost block in the function body, one from the call to
start_lambda_function in tsubst_lambda_expr, and one from tsubsting the
block added by start_lambda_function when we first parsed the lambda. This
messed with the named return value optimization, which only works for
variables in the outermost block.
gcc/cp/ChangeLog:
PR c++/91217
* pt.c (tsubst_lambda_expr): Skip the body block from
DECL_SAVED_TREE.
gcc/testsuite/ChangeLog:
PR c++/91217
* g++.dg/opt/nrv20.C: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/91217] [9/10 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2021-05-20 21:34 ` cvs-commit at gcc dot gnu.org
@ 2021-06-01 8:14 ` rguenth at gcc dot gnu.org
2022-05-13 17:42 ` [Bug c++/91217] [9 " cvs-commit at gcc dot gnu.org
2022-05-13 18:03 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01 8:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.4 |9.5
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/91217] [9 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2021-06-01 8:14 ` rguenth at gcc dot gnu.org
@ 2022-05-13 17:42 ` cvs-commit at gcc dot gnu.org
2022-05-13 18:03 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-13 17:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:da999d938e516ff12b39a0aa7e8f6d97fbee60df
commit r9-10177-gda999d938e516ff12b39a0aa7e8f6d97fbee60df
Author: Jason Merrill <jason@redhat.com>
Date: Sat Apr 3 01:07:36 2021 -0400
c++: NRV in lambda in template [PR91217]
tsubst_lambda_expr was producing a function with two blocks that claimed to
be the outermost block in the function body, one from the call to
start_lambda_function in tsubst_lambda_expr, and one from tsubsting the
block added by start_lambda_function when we first parsed the lambda. This
messed with the named return value optimization, which only works for
variables in the outermost block.
gcc/cp/ChangeLog:
PR c++/91217
* pt.c (tsubst_lambda_expr): Skip the body block from
DECL_SAVED_TREE.
gcc/testsuite/ChangeLog:
PR c++/91217
* g++.dg/opt/nrv20.C: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/91217] [9 Regression] Returning std::array from lambda results in an extra copy step on return
[not found] <bug-91217-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2022-05-13 17:42 ` [Bug c++/91217] [9 " cvs-commit at gcc dot gnu.org
@ 2022-05-13 18:03 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2022-05-13 18:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 9.5/10.4/11.
^ permalink raw reply [flat|nested] 8+ messages in thread