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

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
(gdb) p debug_tree (fn->decl)
 <function_decl 0x7ffff7045f00 soap_getindependent
    type <function_type 0x7ffff7042e70
        type <integer_type 0x7ffff6f155e8 int public SI
            size <integer_cst 0x7ffff6f190a0 constant 32>
            unit size <integer_cst 0x7ffff6f190c0 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7ffff6f155e8
precision 32 min <integer_cst 0x7ffff6f19040 -2147483648> max <integer_cst
0x7ffff6f19060 2147483647>
            pointer_to_this <pointer_type 0x7ffff6f1d2a0>>
        QI
        size <integer_cst 0x7ffff6f04ee0 constant 8>
        unit size <integer_cst 0x7ffff6f04f00 constant 1>
        align 8 symtab 0 alias set 0 canonical type 0x7ffff7042dc8>
    public static QI file a.i line 5 col 1 align 8 context
<translation_unit_decl 0x7ffff7049000 D.2387> initial <block 0x7ffff704d000>
    result <result_decl 0x7ffff7047438 D.2391 type <integer_type 0x7ffff6f155e8
int>
        ignored SI file a.i line 5 col 1 size <integer_cst 0x7ffff6f190a0 32>
unit size <integer_cst 0x7ffff6f190c0 4>
        align 32 context <function_decl 0x7ffff7045b00 soap_getindependent>>
    struct-function 0x7ffff6f10140>
$1 = void
(gdb) p debug_tree (gimple_label_label (stmt))
 <label_decl 0x7ffff704e000 D.2393
    type <void_type 0x7ffff6f15bd0 void VOID
        align 8 symtab 0 alias set -1 canonical type 0x7ffff6f15bd0
        pointer_to_this <pointer_type 0x7ffff6f15c78>>
    ignored VOID file a.i line 8 col 1
    align 1 context <function_decl 0x7ffff7045b00 soap_getindependent>>
$2 = void
(gdb) p debug_tree ((tree)0x7ffff7045b00)
 <function_decl 0x7ffff7045b00 soap_getindependent
    type <function_type 0x7ffff7042e70
        type <integer_type 0x7ffff6f155e8 int public SI
            size <integer_cst 0x7ffff6f190a0 constant 32>
            unit size <integer_cst 0x7ffff6f190c0 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7ffff6f155e8
precision 32 min <integer_cst 0x7ffff6f19040 -2147483648> max <integer_cst
0x7ffff6f19060 2147483647>
            pointer_to_this <pointer_type 0x7ffff6f1d2a0>>
        QI
        size <integer_cst 0x7ffff6f04ee0 constant 8>
        unit size <integer_cst 0x7ffff6f04f00 constant 1>
        align 8 symtab 0 alias set 0 canonical type 0x7ffff7042dc8>
    static QI file b.i line 2 col 1 align 8 context <translation_unit_decl
0x7ffff6f20f18 D.2381>
    result <result_decl 0x7ffff7047168 D.2382 type <integer_type 0x7ffff6f155e8
int>
        ignored SI file b.i line 2 col 1 size <integer_cst 0x7ffff6f190a0 32>
unit size <integer_cst 0x7ffff6f190c0 4>
        align 32 context <function_decl 0x7ffff7045b00 soap_getindependent>>>
$3 = void
(gdb) p debug_symtab_node (symtab_get_node ((tree)0x7ffff7045b00))
soap_getindependent/2 (soap_getindependent) @0x7ffff6f0d980
  Type: function definition analyzed
  Visibility: force_output prevailing_def_ironly
  next sharing asm name: 6
  References: 
  Referring: 
  Read from file: libx.a
  Availability: available
  Function flags:
  Called by: 
  Calls: 
$6 = void
(gdb) p debug_symtab_node (symtab_get_node (fn->decl))
soap_getindependent/6 (soap_getindependent) @0x7ffff6f0de40
  Type: function definition analyzed
  Visibility: force_output externally_visible prevailing_def_ironly public
  previous sharing asm name: 2
  References: 
  Referring: 
  Read from file: libx.a
  Availability: available
  Function flags: body
  Called by: 
  Calls: 

so the problem seems to be that while reading body of the static function
soap_getindependent we manage to mess the context with global function in the
other file. I am not terribly familiar on how LTO sections are mapped...

Reply via email to