This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix flatten-2.c testcase
> On Fri, May 15, 2009 at 5:34 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > this testcase tests flattening of cycles in cgraph containing indirect
> > function call. ?In main inliner we try to give precendece to
> > non-indirect call, but early inliner don't know about the cycles. ?As
> > discussed earlier, we don't make any promises here and I think it is
> > perfectly resonable to inline indirect call and break cycle elsewhere as
> > we do in case of cycles not containing any indirect edges.
> >
> > This patch updates testcase to disable early inlining and adds
> > variant without the additional test that cycle is broken at indirect
> > call as suggested by Richard.
> >
> > Regtested on x86_64-linux and comitted.
>
> Note that I agree with Micha that we should inline the static functions here.
I didn't see any comment from Michael on this. What did he say?
> Thus I think your iteration scheme is sort-of broken - can't you simply only
> consider new cgraph edges that appear during de-virtualization /
> indirect->direct
> call folding?
Well, this is what early inliner does with the patch for indirect
inlining. Real inliner can't do that because de-virtualization and call
folding does not happen when it decide that function will be inlined,
only it happens at a time it is really inlined later.
There is one problem left to solve and it is that we mark functions with
address taken as neccesary during cgraph construction and we never
revisit the decision. So offline copies of static functions with
address taken are always kept around even if they are unnecesary.
I plan to revisit this too, unless PTA analysis won't do the job for me,
but it is bit tricky: since addresses of functions are getting optimized
out by inlining and ipa-cp clonning and this all happens at IPA stage
and we need to fix the decision just after IPA stage before the clones
are actually build, we need to produce summaries here and update them in
both passes that is some work.
Honza