From patchwork Tue Jun 15 12:22:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [c++] rewrite vtable initialization construction to use VECs Date: Tue, 15 Jun 2010 02:22:36 -0000 From: Nathan Froyd X-Patchwork-Id: 55645 Message-Id: <20100615122234.GW27105@codesourcery.com> To: Steve Ellcey Cc: Mark Mitchell , gcc-patches@gcc.gnu.org On Thu, Jun 10, 2010 at 10:05:58AM -0700, Steve Ellcey wrote: > Sorry for not replying sooner but I was on vacation. This change has > broken the ia64-hp-hpux11.23 build where > TARGET_VTABLE_DATA_ENTRY_DISTANCE is set. HP-UX is different then Linux > because it has a 32 bit mode where the value of this is 2 instead of 1 > and I think that is why it works on Linux but not on HP-UX. > > /proj/opensrc_nobackup/nightly2/src/trunk/libstdc++-v3/libsupc++/exception:61:9: internal compiler error: vector VEC(constructor_elt,base) index domain error, in build_vtbl_initializer at cp/class.c:7629 > Please submit a full bug report, > with preprocessed source if appropriate. Ah, whoops, I clearly didn't look closely enough to see what platforms I should have been testing on. I think the patch below does the trick. Could you please try it and report back? -Nathan Index: class.c =================================================================== --- class.c (revision 160473) +++ class.c (working copy) @@ -7624,7 +7624,7 @@ build_vtbl_initializer (tree binfo, for (j = 1; j < TARGET_VTABLE_DATA_ENTRY_DISTANCE; ++j) { - constructor_elt *f = VEC_index (constructor_elt, *inits, + constructor_elt *f = VEC_index (constructor_elt, vid.inits, new_position + j); f->index = NULL_TREE; f->value = build1 (NOP_EXPR, vtable_entry_type,