------- Comment #6 from danglin at gcc dot gnu dot org  2007-07-21 23:17 -------
This is still failing as of 20070721 although the duplicate has changed:

Executing on host: /test/gnu/gcc/objdir/./gcc/g++ -shared-libgcc
-B/test/gnu/gcc
/objdir/./gcc -nostdinc++
-L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++
-v3/src -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src/.libs
-B/o
pt/gnu/gcc/gcc-4.3.0/hppa2.0w-hp-hpux11.11/bin/
-B/opt/gnu/gcc/gcc-4.3.0/hppa2.0
w-hp-hpux11.11/lib/ -isystem
/opt/gnu/gcc/gcc-4.3.0/hppa2.0w-hp-hpux11.11/includ
e -isystem /opt/gnu/gcc/gcc-4.3.0/hppa2.0w-hp-hpux11.11/sys-include -g -O2
-D_GL
IBCXX_ASSERT -fmessage-length=0 -g -O2 -DLOCALEDIR="." -nostdinc++
-I/test/gnu/g
cc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11
-I/te
st/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include
-I/test/gnu/gcc/gcc
/libstdc++-v3/libsupc++ -I/test/gnu/gcc/gcc/libstdc++-v3/include/backward
-I/tes
t/gnu/gcc/gcc/libstdc++-v3/testsuite/util
/test/gnu/gcc/gcc/libstdc++-v3/testsui
te/23_containers/deque/check_construct_destroy.cc    -include bits/stdc++.h
./li
btestc++.a  -lm   -o ./check_construct_destroy.exe    (timeout = 600)
/usr/ccs/bin/ld: Duplicate symbol "global destructors keyed to
1__ZN12_GLOBAL__N
_110new_calledE" in files /var/tmp//ccNwUN5r.o and
./libtestc++.a(testsuite_allo
cator.o)
/usr/ccs/bin/ld: Duplicate symbol "global constructors keyed to
0__ZN12_GLOBAL__
N_110new_calledE" in files /var/tmp//ccNwUN5r.o and
./libtestc++.a(testsuite_all
ocator.o)
/usr/ccs/bin/ld: Duplicate symbol "_GLOBAL__F__ZN12_GLOBAL__N_110new_calledE"
in
 files /var/tmp//ccNwUN5r.o and ./libtestc++.a(testsuite_allocator.o)
/usr/ccs/bin/ld: Found 3 duplicate symbol(s)
collect2: ld returned 1 exit status
compiler exited with status 1
output is:
/usr/ccs/bin/ld: Duplicate symbol "global destructors keyed to
1__ZN12_GLOBAL__N
_110new_calledE" in files /var/tmp//ccNwUN5r.o and
./libtestc++.a(testsuite_allo
cator.o)
/usr/ccs/bin/ld: Duplicate symbol "global constructors keyed to
0__ZN12_GLOBAL__
N_110new_calledE" in files /var/tmp//ccNwUN5r.o and
./libtestc++.a(testsuite_all
ocator.o)
/usr/ccs/bin/ld: Duplicate symbol "_GLOBAL__F__ZN12_GLOBAL__N_110new_calledE"
in
 files /var/tmp//ccNwUN5r.o and ./libtestc++.a(testsuite_allocator.o)
/usr/ccs/bin/ld: Found 3 duplicate symbol(s)
collect2: ld returned 1 exit status

FAIL: 23_containers/deque/check_construct_destroy.cc (test for excess errors)

The symbols from testsuite_allocator.o are:

testsuite_allocator.o:
         U $$dyncall
40000000 b $BSS$
00000000 t $CODE$
00000000 t $CODE$
00000000 t $CODE$
00000000 t $CODE$
00000000 t $CODE$
40000000 d $DATA$
         U $global$
00000000 t L$C0000
00000004 t L$C0001
00000014 t L$C0002
00000024 t L$C0003
00000028 t L$C0004
00000034 t L$C0005
00000000 T _GLOBAL__D_1__ZN12_GLOBAL__N_110new_calledE
40000000 D _GLOBAL__F__ZN12_GLOBAL__N_110new_calledE
00000000 T _GLOBAL__I_0__ZN12_GLOBAL__N_110new_calledE
00000008 C _ZGVZN10__gnu_test19uneq_allocator_base7get_mapEvE9alloc_map
00000000 T _ZN10__gnu_test23check_construct_destroyEPKcii
40000010 B _ZN10__gnu_test25tracker_allocator_counter14destructCount_E
4000000c B _ZN10__gnu_test25tracker_allocator_counter15constructCount_E
40000004 B _ZN10__gnu_test25tracker_allocator_counter16allocationCount_E
40000008 B _ZN10__gnu_test25tracker_allocator_counter18deallocationCount_E
40000000 b _ZN12_GLOBAL__N_110new_calledE
         U _ZNSo3putEc
         U _ZNSo5flushEv
         U _ZNSolsEi
         U _ZNSt8ios_base4InitC1Ev
         U _ZNSt8ios_base4InitD1Ev
         U _ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
         U
_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES
6_PKS3_l
         U _ZSt16__throw_bad_castv
         U _ZSt4cerr
40000014 b _ZStL8__ioinit
         U __gxx_personality_v0
         U memcmp
         U strlen

In this case, notice_global_symbol() is called with a DECL symbol that
is deleted after the call:

Breakpoint 1, notice_global_symbol (decl=0x79f0af60)
    at ../../gcc/gcc/varasm.c:1573
1573      if (DECL_WEAK (decl) || DECL_ONE_ONLY (decl) || flag_shlib)
(gdb) bt
#0  notice_global_symbol (decl=0x79f0af60) at ../../gcc/gcc/varasm.c:1573
#1  0x004829e0 in varpool_enqueue_needed_node (node=0x79f0af60)
    at ../../gcc/gcc/varpool.c:192
#2  0x00482a50 in varpool_mark_needed_node (node=0x7a19c920)
    at ../../gcc/gcc/varpool.c:202
#3  0x004832e0 in varpool_finalize_decl (decl=0x79f0af60)
    at ../../gcc/gcc/varpool.c:297
#4  0x003668a0 in rest_of_decl_compilation (decl=0x79f0af60, top_level=1,
    at_end=0) at ../../gcc/gcc/passes.c:193
#5  0x00052eec in make_rtl_for_nonlocal_decl (decl=0x79f0af60, init=0x0,
    asmspec=0x0) at ../../gcc/gcc/cp/decl.c:5012
#6  0x00063590 in cp_finish_decl (decl=0x79f0af60, init=0x0,
    init_const_expr_p=1 '\001', asmspec_tree=0x3, flags=8)
    at ../../gcc/gcc/cp/decl.c:5370
#7  0x0010fd4c in cp_parser_init_declarator (parser=0x7acd0f88,
    decl_specifiers=0x7eff0ee0, checks=0x0,
    function_definition_allowed_p=1 '\001', member_p=0,
    declares_class_or_enum=0, function_definition_p=0x7eff0ed8 "")
    at ../../gcc/gcc/cp/parser.c:12001
#8  0x00110354 in cp_parser_simple_declaration (parser=0x7acd0f88,
    function_definition_allowed_p=1 '\001') at ../../gcc/gcc/cp/parser.c:7861
#9  0x000f9178 in cp_parser_block_declaration (parser=0x7acd0f88,
    statement_p=0 '\0') at ../../gcc/gcc/cp/parser.c:7761
---Type <return> to continue, or q <return> to quit---
#10 0x00113c90 in cp_parser_declaration (parser=0x7acd0f88)
    at ../../gcc/gcc/cp/parser.c:7669
#11 0x001145d8 in cp_parser_declaration_seq_opt (parser=0x7acd0f88)
    at ../../gcc/gcc/cp/parser.c:7564
#12 0x00113e24 in cp_parser_declaration (parser=0x7acd0f88)
    at ../../gcc/gcc/cp/parser.c:11315
#13 0x001145d8 in cp_parser_declaration_seq_opt (parser=0x7acd0f88)
    at ../../gcc/gcc/cp/parser.c:7564
#14 0x00114f00 in c_parse_file () at ../../gcc/gcc/cp/parser.c:2969
#15 0x001dd9dc in c_common_parse_file (set_yydebug=2045816672)
    at ../../gcc/gcc/c-opts.c:1276
#16 0x00395bec in toplev_main (argc=1073979340, argv=0x4002cf6c)
    at ../../gcc/gcc/toplev.c:1044
#17 0x001f3dac in main (argc=2045816672, argv=0x3) at ../../gcc/gcc/main.c:35
(gdb) p debug_tree (decl)
 <var_decl 79f0af60 new_called
    type <boolean_type 7adf35b0 bool sizes-gimplified public unsigned type_6 QI
        size <integer_cst 7ade1380 constant invariant 8>
        unit size <integer_cst 7ade13a0 constant invariant 1>
        align 8 symtab 22 alias set 36 canonical type 7adf35b0 precision 1 min
<integer_cst 7ade16e0 0> max <integer_cst 7ade1720 1> reference_to_this
<reference_type 7ac074d0>>
    public static tree_1 tree_2 tree_3 unsigned QI file
/test/gnu/gcc/gcc/libstdc++-v3/testsuite/util/testsuite_allocator.h line 45
size <integer_cst 7ade1380 8> unit size <integer_cst 7ade13a0 1>
    align 8 context <namespace_decl 79f27070 D.28300> initial <integer_cst
7ade16e0 0>
    (mem/c/i:QI (symbol_ref:SI ("_ZN12_GLOBAL__N_110new_calledE") [flags 0x2]
<var_decl 79f0af60 new_called>) [36 new_called+0 S1 A8])>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30151

Reply via email to