The arm-none-eabi compiler gets a segmentation fault while building libstdc++. 
A back-trace shows that the fault is in determine_visibility() where we are
dereferencing a null pointer.

#0  determine_visibility (decl=0xbca2e280)
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cp/decl2.c:1753
#1  0x08070697 in start_preparsed_function (decl1=0xbca2e280, attrs=0x0, 
    flags=1) at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cp/decl.c:10610
#2  0x080fd708 in use_thunk (thunk_fndecl=0xbca2e280, emit_p=1 '\001')
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cp/method.c:460
#3  0x0810a4e3 in emit_associated_thunks (fn=0xbca2e180)
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cp/semantics.c:3025
#4  0x0810a5e7 in expand_body (fn=0xbca2e180)
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cp/semantics.c:3065
#5  0x084441cc in cgraph_expand_function (node=0xbcadd770)
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cgraphunit.c:1112
#6  0x08444355 in cgraph_expand_all_functions ()
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cgraphunit.c:1177
#7  0x08444ac6 in cgraph_optimize ()
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cgraphunit.c:1449
#8  0x080ba20f in cp_finish_file ()
    at /home/rearnsha/gnusrc/gcc-cross/trunk/gcc/cp/decl2.c:3310
#9  0x0815aa31 in c_common_parse_file (set_yydebug=0)
...

The decl argument is:

(gdb) call debug_tree (decl)
 <function_decl 0xbca2e280
_ZTv0_n12_NSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
    type <method_type 0xbca29420
        type <pointer_type 0xbda439c0 type <void_type 0xbda43960 void>
            sizes-gimplified asm_written public unsigned type_6 SI
            size <integer_cst 0xbda2c380 constant invariant 32>
            unit size <integer_cst 0xbda2c040 constant invariant 4>
            align 32 symtab -1118697984 alias set 5
            pointer_to_this <pointer_type 0xbda4c7e0> reference_to_this
<reference_type 0xbd735f00>>
        SI size <integer_cst 0xbda2c380 32> unit size <integer_cst 0xbda2c040
4>
        align 32 symtab 0 alias set -1 method basetype <record_type 0xbd0348a0
basic_ofstream<char,std::char_traits<char> >>
        arg-types <tree_list 0xbca26c18 value <pointer_type 0xbca291e0>
            chain <tree_list 0xbda343c0 value <void_type 0xbda43960 void>>>>
    addressable used public static weak in_system_header no-static-chain decl_5
SI file /work/rearnsha/gnu/gcc-eabi/trunk/arm-eabi/libstdc++-v3/include/iosfwd
line 92 context <record_type 0xbd0348a0
basic_ofstream<char,std::char_traits<char> >> initial <block 0xbc9a7ea0>
    arguments <parm_decl 0xbd72c478 this
        type <pointer_type 0xbca292a0 type <record_type 0xbd0348a0
basic_ofstream<char,std::char_traits<char> >>
            readonly public unsigned SI size <integer_cst 0xbda2c380 32> unit
size <integer_cst 0xbda2c040 4>
            align 32 symtab -1131518128 alias set -1>
        readonly used unsigned SI file
/work/rearnsha/gnu/gcc-eabi/trunk/arm-eabi/libstdc++-v3/include/fstream line
585 size <integer_cst 0xbda2c380 32> unit size <integer_cst 0xbda2c040 4>
        align 32 context <function_decl 0xbca2e280
_ZTv0_n12_NSt14basic_ofstreamIcSt11char_traitsIcEED1Ev> initial <pointer_type
0xbca292a0> abstract_origin <parm_decl 0xbca27c08 this> arg-type <pointer_type
0xbca292a0>>
    result <result_decl 0xbd72c948 D.33297 type <pointer_type 0xbda439c0>
        unsigned ignored SI file
/home/rearnsha/gnusrc/gcc-cross/trunk/libstdc++-v3/src/fstream-inst.cc line 50
size <integer_cst 0xbda2c380 32> unit size <integer_cst 0xbda2c040 4>
        align 32>

    saved-insns 0xbd8b8bfc>


-- 
           Summary: [4.2 regression] Bootstrap failure on arm-eabi
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, build, visibility
          Severity: blocker
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rearnsha at gcc dot gnu dot org
GCC target triplet: arm-none-eabi


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

Reply via email to