This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: attribute((leafify)) for 3.4
> Hi!
>
> I finally found what is throwing away function bodies wrongly for me.
> It's tree_rest_of_compilation()! I suppose, when under cgraph control,
> its not neccessary to
>
> /* If possible, obliterate the body of the function so that it can
> be garbage collected. */
> if (dump_enabled_p (TDI_all))
> /* Keep the body; we're going to dump it. */
> ;
> else if (DECL_INLINE (fndecl) && flag_inline_trees)
> /* We might need the body of this function so that we can expand
> it inline somewhere else. */
> ;
> else
> /* We don't need the body; blow it away. */
> DECL_SAVED_TREE (fndecl) = NULL;
>
> so I guarded the inline check with flag_unit_at_a_time as follows:
>
> ...
> else if (flag_unit_at_a_time || (DECL_INLINE (fndecl) && flag_inline_trees))
> /* We might need the body of this function so that we can expand
> it inline somewhere else. */
> ;
> ...
>
> but maybe even the whole throwing away the decl can be disabled for
> unit-at-a-time.
I tought this was done for ages already!
(I definitly made patch for this). I will commit ovious patch for this
soonish.
Thanks
Honza
>
> Richard.
>
> --
> Richard Guenther <richard dot guenther at uni-tuebingen dot de>
> WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
>