This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IA64 HP-UX patch for C++ (Modified)




--On Monday, September 30, 2002 10:26:06 AM -0700 Richard Henderson <rth@redhat.com> wrote:

On Mon, Sep 30, 2002 at 10:17:00AM -0700, Steve Ellcey wrote:
	* class.c (build_vtbl_initializer): Add cast.
	(add_vcall_offset_vtbl_entries_1):
	Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset.
Ok.
No, actually, it's not.

build_c_cast is not the right function to be using here.

That's the function that processes a cast when the user writes it.  It
does a bunch of error-checking and checks for user-defined conversions
and who knows what else.  Here, we just want to do the conversion.  This
kind of mistake is littered around the C++ front end, but it has to stop.

In this case, we want a NULL pointer of type vtable_entry_type (known to
be a pointer type).

We could create a routine for that, but the code is:

 build1 (NOP_EXPR, vtable_entry_type, null_pointer_node);

Steve, please adjust your patch accordingly.

Thanks,

--
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]