__attribute__((leafify))

Richard Guenther rguenth@tat.physik.uni-tuebingen.de
Fri Jun 6 14:38:00 GMT 2003


On Tue, 3 Jun 2003, Joseph S. Myers wrote:

> On Tue, 3 Jun 2003, Richard Guenther wrote:
>
> > So what is this __attribute__((leafify))? Its a way to tell gcc to make
> > the marked function a leaf of the cfg, i.e. to inline every call made in
> > this function ignoring all inlining limits. A patch for mainline was
> > posted at
> > http://gcc.gnu.org/ml/gcc-patches/2003-05/msg01662.html
>
> Your patch doesn't have testcases.  They should include:
>
> * That the attribute does indeed work.  This could be tricky but you
> should be able e.g. to check for the names of static functions in the
> assembler output, where those functions would only be inlined when the
> attribute is given.

While trying to address this issue I found that __attribute__((leafify))
indeed does _not_ work :( The problem is we usually have thrown away the
trees for the to-be inlined functions, which are not marked as to be
inlined by marking the caller leafify. Ugh. I suppose this can be fixed
with the unit-at-a-time global CFG? So __attribute__((leafify)) would
either depend on the user marking relevant functions inline and hope
the compiler does expansion in the right order (just specifying
-finline-functions is not enough for moderately complex testcases) or
depend on -funit-at-a-time which is not yet available for C++?

Jan? Any different suggestions?

Thanks,

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/



More information about the Gcc mailing list