Index: config-lang.in =================================================================== RCS file: /cvs/gcc/gcc/gcc/cp/config-lang.in,v retrieving revision 1.25 diff -u -p -r1.25 config-lang.in --- config-lang.in 14 Jul 2004 15:34:29 -0000 1.25 +++ config-lang.in 25 Jan 2005 06:47:43 -0000 @@ -34,4 +34,4 @@ stagestuff="g++\$(exeext) g++-cross\$(ex target_libs="target-libstdc++-v3 target-gperf" -gtfiles="\$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c" +gtfiles="\$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c \$(srcdir)/cp/class.c" Index: class.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v retrieving revision 1.701 diff -u -p -r1.701 class.c --- class.c 17 Jan 2005 08:08:09 -0000 1.701 +++ class.c 25 Jan 2005 06:47:44 -0000 @@ -7063,6 +7063,8 @@ dfs_accumulate_vtbl_inits (tree binfo, return inits; } +static GTY(()) tree abort_fndecl_addr; + /* Construct the initializer for BINFO's virtual function table. BINFO is part of the hierarchy dominated by T. If we're building a construction vtable, the ORIG_BINFO is the binfo we should use to @@ -7212,16 +7214,24 @@ build_vtbl_initializer (tree binfo, /* You can't call an abstract virtual function; it's abstract. So, we replace these functions with __pure_virtual. */ if (DECL_PURE_VIRTUAL_P (fn_original)) - fn = abort_fndecl; - else if (!integer_zerop (delta) || vcall_index) { - fn = make_thunk (fn, /*this_adjusting=*/1, delta, vcall_index); - if (!DECL_NAME (fn)) - finish_thunk (fn); + fn = abort_fndecl; + if (abort_fndecl_addr == NULL) + abort_fndecl_addr = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); + init = abort_fndecl_addr; + } + else + { + if (!integer_zerop (delta) || vcall_index) + { + fn = make_thunk (fn, /*this_adjusting=*/1, delta, vcall_index); + if (!DECL_NAME (fn)) + finish_thunk (fn); + } + /* Take the address of the function, considering it to be of an + appropriate generic type. */ + init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); } - /* Take the address of the function, considering it to be of an - appropriate generic type. */ - init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); } /* And add it to the chain of initializers. */ @@ -7682,3 +7692,4 @@ cp_fold_obj_type_ref (tree ref, tree kno return build_address (fndecl); } +#include "gt-cp-class.h"