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.
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.
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.
Jeff