Am Thu, 3 Jan 2013 16:47:00 +0000
schrieb Iain Buclaw <ibuclaw@ubuntu.com>:
> > Then there's the question why the outer function has to be a
> > template as well for this to happen: It's because if it's not a
> > template, gdc uses a completely different code path: There's a
> > "!gen.functionNeedsChain (f)" check in outputFunction which is false
> > for the failing case. (cgraph_finalize_function marks the function
> > as reachable)
> >
> >
> That might be just it then...I admit I don't really know why this check is needed but even if I try
to call cgraph_finalize_function for indirectLess the backend dies with
the same error. Actually my statement above was wrong,
cgraph_finalize_function only marks the function as reachable if it's
TREE_PUBLIC/. The not-templated case works even without
cgraph_finalize_function so that's not the issue.
>I see! That's why percolateDown is public, but isn't it essentially a
> I have been rolling round my head to remove the notion of functions
> nested in functions within the D codegen. Having only RECORD and
> UNION types set in DECL_CONTEXT. So all public functions are
> TREE_PUBLIC=1 (unless there's some overriding attribute), and all
> nested functions are TREE_PUBLIC=0.
nested function in the test case?