This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Constant pointer to (member) function, indirect call
- From: Helge Bahmann <hcb at chaoticmind dot net>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 2 Mar 2005 14:54:44 +0100 (CET)
- Subject: Re: Constant pointer to (member) function, indirect call
On Tue, 1 Mar 2005 Mark Mitchell wrote:
> 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.
hm... it is not that my life depends on it, but is there a way to tell the
compiler "this member function pointer will never point to a virtual
function"? (especially because I know it is constant?)
Best regards