C++ ptrmemfun break if FUNCTION_BOUNDARY < 2 * BITS_PER_UNIT

Neil Booth neil@daikokuya.demon.co.uk
Fri Apr 6 10:53:00 GMT 2001


Alexandre Oliva wrote:-

> The C++ ABI v3 uses the least significant bit of the pfn to tell
> non-virtual from virtual functions.  The problem is that, on
> architectures that don't impose any alignment requirements on
> beginning of functions, the assumption that pfn&1 == 0 for pointers to
> non-virtual member functions doesn't always hold.  This breaks C++ on
> at least avr, elxsi, mn10200, mn10300 and pj.

Presumably those archs where you can't use the low bit have a small
memory space anyway.  Maybe the address types are wide enough that you
can use the high bit instead?  That'd allow you to just define a macro

VIRTUAL_FUNCTION_BIT

and mask with that.  Or maybe I have no idea what I'm talking about :-)

Neil.



More information about the Gcc mailing list