Re: [PATCH] c++: Avoid unnecessary copying in cp_fold [PR94038]

2020-05-04 Thread Jason Merrill via Gcc-patches
On 5/4/20 3:44 PM, Patrick Palka wrote: When folding a CALL_EXPR, we can avoid copying it until folding changes one of its arguments. And when folding a TREE_VEC, we can avoid using an intermediate releasing_vec by working with a copy of the TREE_VEC as soon as folding changes one of its argumen

[PATCH] c++: Avoid unnecessary copying in cp_fold [PR94038]

2020-05-04 Thread Patrick Palka via Gcc-patches
When folding a CALL_EXPR, we can avoid copying it until folding changes one of its arguments. And when folding a TREE_VEC, we can avoid using an intermediate releasing_vec by working with a copy of the TREE_VEC as soon as folding changes one of its arguments, like we do in the CALL_EXPR case. Inc