On 08/07/2012 08:29 AM, Martin Jambor wrote: > So I did the testing and unfortunately this only works for the first > virtual function of a class, the sequence calling any other virtual > function has one more statement which adds VMT offset to the > typecasted pointer and after folding we end up calling stuff like > MEM[f1+16B]() instead of f2() in g++.dg/template/ptrmem18.C.
Yes. The ia64 vtable format has the function descriptors directly in the table. See TARGET_VTABLE_USES_DESCRIPTORS. It is unique in this feature so far (although if another new abi decides to use function descriptors at all, I would recommend this as well). Thus &vtable[index] is the "function pointer" that is passed to the backend for expansion in the call sequence. r~