On 11/27/2013 05:59 PM, Iyer, Balaji V wrote:
Well, if I use copy_tree_body_r for C and C++, in lambda functions, it asserts
in varasm.c. The main reason I see that, the copy_tree_body_r walks into the
closure and then maps the variables from the lambda function from the spawner
to the helper function.
It walks into the initializer for the closure object, yes. And gets
confused by the initializer in the
_Cilk_spawn [=](int *Aa, int size){ foo1_c(A, size); }(B, 2);
case. The initializer for the closure is a CONSTRUCTOR which contains a
reference to A, and that is running into trouble because
extract_free_variables doesn't walk into CONSTRUCTORs. You probably
want to switch a lot of your tree walking functions to use walk_tree
directly rather than try to keep up with all the different kinds of
expressions yourself.
Jason