Hi JunMa,
JunMa <ju...@linux.alibaba.com> wrote:
Hi
Accroding to N4835: When a coroutine is invoked, a copy is created
for each coroutine parameter. While in current implementation, we
only collect used parameters. This may lost behavior inside constructor
and destructor of unused parameters.
This patch change the implementation to collect all parameter.
thanks for the patch.
I am not convinced this is the right way to fix this, we do not want to
increase
the size of the coroutine frame unnecessarily. I would like to check the
lifetime
requirements; such copies might only need to be made local to the ramp
function.
Iain
Bootstrap and test on X86_64, is it OK?
Regards
JunMa
gcc/cp
2020-01-20 Jun Ma <ju...@linux.alibaba.com>
* coroutines.cc (build_actor_fn): Skip rewrite when there is no
param references.
(register_param_uses): Only collect param references here.
(morph_fn_to_coro): Create coroutine frame field for each
function params.
gcc/testsuite
2020-01-20 Jun Ma <ju...@linux.alibaba.com>
* g++.dg/coroutines/torture/func-params-07.C: New test.
<0001-Fix-issue-when-copy-function-parameters-into-corouti.patch>