This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, PR 45699] Devirtualize to thunks


Jan Hubicka wrote:
>  Hi,
>
>  folding of OBJ_TYPE_REFs just takes the function declaration in BINFOs
>  and puts into the call statement.  Unfortunately BINFOs do not put the
>  declaration of the proper thunk there and so we might ending up not
>  adjusting the this pointer like in the testcase below.  On the other
>  hand, BINFOs do contain the deltas and so the folding code can look up
>  the right thunk in the call graph if need be.  This is what the patch
>  below does.
Thank you! That's great. I can now test gcc 4.6 at -O and -O2... O3 still gives segfaults.

>
>  Bootstrapped and tested on x86_64-linux without any issues.  OK for
>  trunk?

I guess we should also add an folder that transforms calls to thunk to call to
the function so inlining and other IPA stuff work?
At the moment i think both ipa-prop and inliner will get direct calls to thunks wrong.
Should I submit a bugzilla bug for this, as is, or do you need a testcase?
(I'm sure I can get one by whittling down my code, but last time it took about 4 hours to do this, so if there's a faster way ... :-P)


-BenRI


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]