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] Fix incorrect devirtualization (PR middle-end/48661)


On 04/19/2011 12:07 AM, Jakub Jelinek wrote:
On Mon, Apr 18, 2011 at 03:33:18PM -0700, Jason Merrill wrote:

Well, it means that we do dynamic adjustment at runtime.  If we're
able to do devirtualization, we should be able to figure out the
right offset as well, just not in 4.6.

Sure, but how exactly? If BV_VCALL_INDEX is non-NULL, I guess we need to find for the given binfo corresponding rtti_binfo that was (or would be if vtable isn't emitted in the current TU) used in build_rtti_vtbl_entries to compute the difference between BINFO_OFFSETs:

The vcall entries are added by add_vcall_offset; the rtti entry is just used for dynamic_cast<void*>.


Or do you think it should just add to the delta the value read from the
vcall_offset from the vtable?

That's what the thunk does; if devirtualization can look up the vcall offset in the vtable, then it should do that.


Jason


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