This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: _Cilk_spawn and _Cilk_sync for C++
- From: Jason Merrill <jason at redhat dot com>
- To: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jeff Law <law at redhat dot com>
- Date: Thu, 28 Nov 2013 09:10:57 -0500
- Subject: Re: _Cilk_spawn and _Cilk_sync for C++
- Authentication-results: sourceware.org; auth=none
- References: <BF230D13CA30DD48930C31D4099330003A4A696B at FMSMSX101 dot amr dot corp dot intel dot com> <528E57DE dot 90900 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AA318 at FMSMSX101 dot amr dot corp dot intel dot com> <528F7D81 dot 4000308 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AC201 at FMSMSX101 dot amr dot corp dot intel dot com> <52962F1A dot 8090205 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4ACF94 at FMSMSX101 dot amr dot corp dot intel dot com> <5296407C dot 40907 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AD241 at FMSMSX101 dot amr dot corp dot intel dot com> <52969B3A dot 9070506 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AD323 at FMSMSX101 dot amr dot corp dot intel dot com>
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