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 11:05 PM, Iyer, Balaji V wrote:
Found the bug. I was not utilizing the stabilize_expr's output correctly.

Unfortunately, I think I was misleading you with talk of stabilize; like you said, you want to evaluate the whole expression in the spawned function rather than in the caller, so that any temporaries (including the lambda closure) live until the _Cilk_sync. Using stabilize_expr this way (the way I was suggesting) forces the lambda closure to be evaluated in the caller, and then destroyed at the end of the enclosing statement, which is likely to erase any data that the spawned function needs to do its work, if anything captured by copy has a destructor.

As I said in my last mail, I think the right fix is to make sure that A gets remapped properly during copy_body so that its use in the initializer for the closure doesn't confuse later passes.

Jason


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