This is the mail archive of the gcc-bugs@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]

[Bug c++/33358] Slow calls through simple member function pointers



------- Comment #2 from dleska at gmail dot com  2007-09-09 06:47 -------
(In reply to comment #1)
> VS seems to dispatch to some other function.

Yep - if the function is virtual, VS generates a stub that does the vtable
lookup.  However for non virtual function the call is direct - which is much
faster than what gcc does.

Note that if I replace the first line of my example with 'class SomeClass;' -
gcc and VS generate comparable code. However when the class is defined at the
point of the call and does not use multiple/virtual inheritance, VS generates
significantly faster calls (at least for non-virtual functions).

Is this optimisation not possible in gcc?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33358


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