Hi Mikael,
Attached is what I had in mind. And a testcase (the '|| expr->expr_type == EXPR_FUNCTION' in copy_walk_reduction_arg appeared wrong to me, and it was seemingly).
Yes, you can also do it this way. OK if accompanied by a ChangeLog entry and my test cases, as well :-) Thomas