From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Oliva To: Jim Wilson Cc: gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org, gdb@sources.redhat.com Subject: Re: C++ ptrmemfun break if FUNCTION_BOUNDARY < 2 * BITS_PER_UNIT Date: Mon, 09 Apr 2001 08:19:00 -0000 Message-id: References: <200104062005.NAA13684@wilson.cygnus.com> X-SW-Source: 2001-04/msg00071.html On Apr 6, 2001, Jim Wilson wrote: >In article you write: >> The C++ ABI v3 uses the least significant bit of the pfn to tell >> non-virtual from virtual functions. > There are also targets that use the low-order bit of the PC to determine > processor mode. Good point. I think this is enough of a reason for us to have a target configuration flag to switch between two different representations of pointers to member functions. I wonder how GDB is going to be able to tell one representation from the other... Perhaps it's going to have to be hard-coded in GDB? > This is also a problem for word addressable machines. In that case, all > bits of the address are significant, and there aren't any unused lower-bits > that can be used by the C++ front end. Here's the approach I propose to work around this problem. I haven't got to setting PTRMEMFUNC_VBIT_IN_DELTA for any targets. Are there any architectures supported by GCC other than MIPS and ARM that would require this setting? Should these be dependent on any particular command-line flags (given that using the lowest bit of pfn is certainly more efficient than having to shift delta)? Is it safe to use arithmetic SHIFTs instead of letting the compiler choose them instead of DIVs and MULTs? For some reason, on mn10300-elf, the div makes it to the generated code, which we certainly don't want. This was not thoroughly tested yet, as it's just a proposal of how to approach the problem. In case people agree this is the way to go, I'll go ahead and test it on a few targets. But something like this should definitely go in 3.0, to avoid ABI changes in the future.