This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix flatten-2.c testcase
> >> 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.
>
> But doesn't flattening / always_inline only happen during early inline anyway?
No, late inliner honors always_inline and calls incremental inliner for
flattening.
>
> > 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.
>
> Hm, indeed.
cgraph now has new address_taken flag. My basic plan is to recompute it
after early optimization (so devirtualization/indirect call removal
during early optimization is taken into account) first. Next we need to
actually collect indirect reference edges and update them during
inlining/clonning and remove address_taken flag on functions that are no
longer refered indirectly...
Honza
>
> Richard.
>
> > Honza
> >