This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: PR29066 ptrmemfunc_vbit_in_delta is broken
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Ryan Mansfield <RMansfield at qnx dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 12 Nov 2006 11:30:04 -0800
- Subject: Re: [PATCH]: PR29066 ptrmemfunc_vbit_in_delta is broken
- References: <3518719F06577C4F85DA618E3C37AB9106FDB59A@nimbus.ott.qnx.com>
Ryan Mansfield wrote:
> Hi,
>
> In build_binary_op, the NE_EXPR/EQ_EXPR comparison of a ptrmemfunc type to a
> null_ptr_cst only looks at the pfn. This breaks ptrmemfunc_vbit_in_delta
> targets as it is possible to have a pfn of 0.
On such a target, what does a PFN of zero and a DELTA of 2 indicate?
That's a non-virtual function call, with an offset of 2; therefore, I
would think that is a NULL pointer.
I would expect that kind of thing could arise with something like:
struct A {
int i;
};
struct B {
int j;
};
struct C : public A, B {
};
void (B::*p)() = 0;
void (C::*q)() = q;
since, here, the compiler just needs to update delta; it has no need to
check PFN. Therefore, I would expect that your code should explicitly
check DELTA & 1, rather than just DELTA.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713