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

--- Comment #9 from Iain Sandoe <iains at gcc dot gnu.org> 2011-11-04 10:50:36 
UTC ---
in tree-emults:
(gdb) call debug_tree(var->decl)
 <var_decl 0x41da24e0 i
    type <integer_type 0x41d17360 int public SI
        size <integer_cst 0x41d0455c constant 32>
        unit size <integer_cst 0x41d04578 constant 4>
        align 32 symtab 0 alias set -1 canonical type 0x41d17360 precision 32
min <integer_cst 0x41d04850 -2147483648> max <integer_cst 0x41d0486c
2147483647>
        pointer_to_this <pointer_type 0x41d17a80>>
    public static tls-global-dynamic SI file ../tests/common-var.C line 4 col
14 size <integer_cst 0x41d0455c 32> unit size <integer_cst 0x41d04578 4>
    align 32 context <translation_unit_decl 0x41d1fec4 D.1589>
    (mem/c/i:SI (symbol_ref:SI ("i") [flags 0x1412] <var_decl 0x41da24e0 i>) [0
i+0 S4 A32])>

===
(gdb) call debug_tree(cdecl)
 <var_decl 0x41da2660 __emutls_v.i
    type <record_type 0x41da2600 __emutls_object BLK
        size <integer_cst 0x41d04a48 constant 128>
        unit size <integer_cst 0x41d04a64 constant 16>
        align 32 symtab 0 alias set -1 canonical type 0x41da2600
        fields <field_decl 0x41d1233c __size type <integer_type 0x41d173c0
unsigned int>
            unsigned SI file (null) line 0 col 0
            size <integer_cst 0x41d0455c constant 32>
            unit size <integer_cst 0x41d04578 constant 4>
            align 32 offset_align 128
            offset <integer_cst 0x41d04594 constant 0>
            bit offset <integer_cst 0x41d04620 constant 0> context <record_type
0x41da2600 __emutls_object> chain <field_decl 0x41d122e0 __align>>>
    public static ignored BLK file ../tests/common-var.C line 4 col 14 size
<integer_cst 0x41d04a48 128> unit size <integer_cst 0x41d04a64 16>
    align 32 context <translation_unit_decl 0x41d1fec4 D.1589> initial
<constructor 0x41d3ac90>
    (mem/s/c:BLK (symbol_ref:SI ("__emutls_v.i") [flags 0x1402] <var_decl
0x41da2660 __emutls_v.i>) [0 __emutls_v.i+0 S16 A32])>

===

there are a lot of calls to cgraph_remove_unreachable_nodes () ... and it seems
that there are two vnodes:

(gdb) call debug_tree(vnode->decl)
 <var_decl 0x41da2660 __emutls_v.i
    type <record_type 0x41da2600 __emutls_object BLK
        size <integer_cst 0x41d04a48 constant 128>
        unit size <integer_cst 0x41d04a64 constant 16>
        align 32 symtab 0 alias set -1 canonical type 0x41da2600
        fields <field_decl 0x41d1233c __size type <integer_type 0x41d173c0
unsigned int>
            unsigned SI file (null) line 0 col 0
            size <integer_cst 0x41d0455c constant 32>
            unit size <integer_cst 0x41d04578 constant 4>
            align 32 offset_align 128
            offset <integer_cst 0x41d04594 constant 0>
            bit offset <integer_cst 0x41d04620 constant 0> context <record_type
0x41da2600 __emutls_object> chain <field_decl 0x41d122e0 __align>>>
    public static ignored BLK file ../tests/common-var.C line 4 col 14 size
<integer_cst 0x41d04a48 128> unit size <integer_cst 0x41d04a64 16>
    align 32 context <translation_unit_decl 0x41d1fec4 D.1589> initial
<constructor 0x41d3ac90>
    (mem/s/c:BLK (symbol_ref:SI ("__emutls_v.i") [flags 0x1402] <var_decl
0x41da2660 __emutls_v.i>) [0 __emutls_v.i+0 S16 A32])>

(gdb) call debug_tree(vnode->decl)
 <var_decl 0x41da24e0 i
    type <integer_type 0x41d17360 int public SI
        size <integer_cst 0x41d0455c constant 32>
        unit size <integer_cst 0x41d04578 constant 4>
        align 32 symtab 0 alias set -1 canonical type 0x41d17360 precision 32
min <integer_cst 0x41d04850 -2147483648> max <integer_cst 0x41d0486c
2147483647>
        pointer_to_this <pointer_type 0x41d17a80>>
    public static tls-global-dynamic SI file ../tests/common-var.C line 4 col
14 size <integer_cst 0x41d0455c 32> unit size <integer_cst 0x41d04578 4>
    align 32 context <translation_unit_decl 0x41d1fec4 D.1589>
    (mem/c/i:SI (symbol_ref:SI ("i") [flags 0x1412] <var_decl 0x41da24e0 i>) [0
i+0 S4 A32])
    value-expr <var_decl 0x41da2660 __emutls_v.i
        type <record_type 0x41da2600 __emutls_object BLK
            size <integer_cst 0x41d04a48 constant 128>
            unit size <integer_cst 0x41d04a64 constant 16>
            align 32 symtab 0 alias set -1 canonical type 0x41da2600 fields
<field_decl 0x41d1233c __size>>
        public static ignored BLK file ../tests/common-var.C line 4 col 14 size
<integer_cst 0x41d04a48 128> unit size <integer_cst 0x41d04a64 16>
        align 32 context <translation_unit_decl 0x41d1fec4 D.1589> initial
<constructor 0x41d3ac90>
        (mem/s/c:BLK (symbol_ref:SI ("__emutls_v.i") [flags 0x1402] <var_decl
0x41da2660 __emutls_v.i>) [0 __emutls_v.i+0 S16 A32])>>

the second seems to be marked as needed and the first is not.

.. not sure where I'm going with the debugging here .. not familiar with this
part of the system.

Reply via email to