This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ ptrmemfun break if FUNCTION_BOUNDARY < 2 * BITS_PER_UNIT
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Subject: Re: C++ ptrmemfun break if FUNCTION_BOUNDARY < 2 * BITS_PER_UNIT
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Sat, 07 Apr 2001 12:52:34 +0100
- cc: Alexandre Oliva <aoliva at redhat dot com>, gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: Richard dot Earnshaw at arm dot com
> 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.
Nope.
> Maybe the address types are wide enough that you
> can use the high bit instead?
Nope.
>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 :-)
All 32 bits in an ARM pointer have meaning in some context or another.
There are no spare ones for this sort of diddling.
I think you need to find another way to represent this information.
R.