Constant pointer to (member) function, indirect call

Mark Mitchell mark@codesourcery.com
Tue Mar 1 22:55:00 GMT 2005


Helge Bahmann wrote:
>     void (A::*function2)(void) throw()=&A::function2;
>     (a.*function2)();

> however for the call through pointer function2 gcc will always generate an
> indirect call, i386 assembly for example looks like:

Yes, it should be able to do so, but it's not.  This is probably 
something that could be done via range propagation.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc mailing list