[Bug lto/51573] [4.7 Regression] ICE (segfault) in lto_varpool_encoder_encode_initializer_p

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 16 10:24:00 GMT 2011


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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-16 09:41:06 UTC ---
We are streaming TYPE_BINFO of 'T', of that BINFO_VTABLE which is &_ZTV1T + 16
and when processing _ZTV1T:

 <var_decl 0x7ffff5a2c140 _ZTV1T
    type <array_type 0x7ffff5b8e9d8
        type <pointer_type 0x7ffff5b83f18 __vtbl_ptr_type type <function_type
0x7ffff5b83e70>
            unsigned DI
            size <integer_cst 0x7ffff5a20f40 constant 64>
            unit size <integer_cst 0x7ffff5a20f60 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x7ffff5b83f18
            pointer_to_this <pointer_type 0x7ffff5b870a8>>
...
    readonly public static ignored external weak virtual decl_5 BLK file t.ii
line 1 col 8 size <integer_cst 0x7ffff5a3c720 192> unit size <integer_cst
0x7ffff5a3c6e0 24>
    align 64 context <record_type 0x7ffff5b8e348 T> initial <constructor
0x7ffff5b64dc8>
    not-really-extern>

we want to encode the initializer.

That all seems ok - the issue is that we ultimately come from streaming
BLOCK_VARS of the main function outermost scope, which refers to 'fn'
whose type refers to 'T'.  And indeed - we shouldn't make ref_p false
for all streams streamed by streamer_write_chain but only the immediate
tree which contains the TREE_CHAIN pointer ... (we can be lucky if
those trees were all streamed already - we'd get references nevertheless,
so it's now dependent on the streaming order whether we happen to trigger
this bug).



More information about the Gcc-bugs mailing list