This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _Cilk_spawn and _Cilk_sync for C++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]