]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: coroutines and return in registers [PR118874]
authorJason Merrill <jason@redhat.com>
Wed, 5 Mar 2025 13:45:34 +0000 (08:45 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 5 Mar 2025 16:58:56 +0000 (11:58 -0500)
commit7e576d5b64ae92432fc2749b8f66105cee8db356
treeddebe7073e4511415278e0d6b215a044ae5b7588
parent4d0a333ef13e2da140cd44c4941b20f48a80dc0f
c++: coroutines and return in registers [PR118874]

Because coroutines insert a call to the resumer between the initialization
of the return value and the actual return to the caller, we need to
duplicate the work of gimplify_return_expr for the !aggregate_value_p case.

PR c++/117364
PR c++/118874

gcc/cp/ChangeLog:

* coroutines.cc (cp_coroutine_transform::build_ramp_function): For
!aggregate_value_p return force return value into a local temp.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/torture/pr118874.C: New test.

Co-authored-by: Jakub Jelinek <jakub@redhat.com>
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/torture/pr118874.C [new file with mode: 0644]