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/25/2013 10:50 AM, Iyer, Balaji V wrote:
I have fixed this issue.  My function to map the variable's context from the spawner to the spawn helper function was going into the lambda function. I made it stop by adding a language specific copy_tree_body (basically stop going into the lambda function's body for C++ and for the rest of the times just use copy_tree_body_r, no code duplicating  is done between the two) that and it works fine now.

I doubt it was walking from the enclosing function into the body of the lambda function. Looking at the patch, it seems that what you're avoiding is walking into the closure object itself, and adding an entire new langhook seems like overkill for that.

I think a better approach would be to add a cp_build_cilk_spawn that uses stabilize_call to pre-evaluate the arguments of the call.

Jason


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