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: [C++ PATCH] TREE_LISTectomy of rtti.c


Nathan Sidwell wrote:
Hi,
I've installed this patch, which replaces rtti's use of TREE_LIST with a bespoke structure and VEC.


booted & tested on i686-pc-linux-gnu.

*************** get_tinfo_decl (tree type)
*** 343,351 ****
d = IDENTIFIER_GLOBAL_VALUE (name);
if (!d)
{
! tree var_desc = get_pseudo_ti_desc (type);
! d = build_lang_decl (VAR_DECL, name, TINFO_PSEUDO_TYPE (var_desc));
SET_DECL_ASSEMBLER_NAME (d, name);
/* Remember the type it is for. */
TREE_TYPE (name) = type;
--- 369,378 ----
d = IDENTIFIER_GLOBAL_VALUE (name);
if (!d)
{
! tinfo_s *ti = VEC_index (tinfo_s, tinfo_descs,
! get_pseudo_ti_index (type));
! d = build_lang_decl (VAR_DECL, name, ti->type);
SET_DECL_ASSEMBLER_NAME (d, name);
/* Remember the type it is for. */
TREE_TYPE (name) = type;

Trying this patch with an arm-elf-linux target, I find the build fails in libstdc++:


../../../../libstdc++-v3/src/codecvt.cc -o codecvt.o
/home/nick/riscos-elf/gcc-4.1/arm-elf-riscos/arm-elf-riscos/libstdc++-v3/include/bits/locale_facets.h:676: internal compiler error: Segmentation fault


'ti->type' in this instance is NULL.


Program received signal SIGSEGV, Segmentation fault.
layout_decl (decl=0x8cd0a8c, known_align=0) at ../../gcc/stor-layout.c:318
318 DECL_UNSIGNED (decl) = TYPE_UNSIGNED (type);
(gdb) bt
#0 layout_decl (decl=0x8cd0a8c, known_align=0) at ../../gcc/stor-layout.c:318
#1 0x082a2e73 in build_decl_stat (code=VAR_DECL, name=0x0, type=0x0) at ../../gcc/tree.c:2873
#2 0x08082175 in build_lang_decl (code=VAR_DECL, name=0x8c99e6c, type=0x0) at ../../gcc/cp/lex.c:668
#3 0x08090483 in get_tinfo_decl (type=0x87304a4) at ../../gcc/cp/rtti.c:375
#4 0x08077c28 in accumulate_vtbl_inits (binfo=0x89bad40, orig_binfo=0x89bad40, rtti_binfo=0x89bad40, t=0x87304a4, inits=0x8ccd7b0) at ../../gcc/cp/class.c:7654
#5 0x08078af1 in finish_struct_1 (t=0x87304a4) at ../../gcc/cp/class.c:6576
#6 0x08079a9d in finish_struct (t=0x87304a4, attributes=0x0) at ../../gcc/cp/class.c:5114



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