On Mon, 28 Nov 2016, Jeff Law wrote:

> On 11/15/2016 07:58 AM, Richard Biener wrote:
> > 
> > Appearantly for some unknown reason we refuse to inline anything into
> > functions calling cilk_spawn.  That breaks fortified headers and
> > all other always-inline function calls (intrinsics come to my mind as
> > well).
> > 
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, ok for trunk?
> > 
> > Thanks,
> > Richard.
> > 
> > 2016-11-15  Richard Biener  <rguent...@suse.de>
> > 
> >     PR tree-optimization/78306
> >     * ipa-inline-analysis.c (initialize_inline_failed): Do not
> >     inhibit inlining if function calls cilk_spawn.
> >     (can_inline_edge_p): Likewise.
> > 
> >     * gcc.dg/cilk-plus/pr78306.c: New testcase.
> Balaji added this check explicitly. There should be tests in the testsuite
> (spawnee_inline, spawner_inline) which exercise that code.

Yes he did, but no, nothing in the testsuite.

> I suspect those bits were taken into the trunk as-is and were missed during
> the review cycle.  The actual tests look to only verify that we don't crash at
> runtime -- they do nothing to verify we get the correct results.

Well, I don't know Cilk+ but it seems to be unmaintained.  Maybe it's time
to rip it out.

> My understanding of Cilk is that it should be possible to literally define
> away the Cilk keywords and the resulting program should "just work".  It would
> seem that if we must avoid inlining to get proper behavior around a cilk_spawn
> then cilk_spawn is perhaps more fragile than it ought to be.

There is _nowhere_ documented _why_ the checks were added.  Why is 
inlining a transform that can do anything bad to a function using
cilk_spawn?

Note that we can't simply disable inlining here (see the PR).

So what exactly is it that we need to avoid?  Inlining of sth
calling cilk_spawn into a function calling cilk_spawn?

Note CCing several intel people didn't come up with any answer.  And
appearantly no, there was no testcase added for this issue.  It all
was present in the initial commit.

Richard.

-- 
Richard Biener <rguent...@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 
21284 (AG Nuernberg)

Reply via email to