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



Richard Biener <rguenth at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

           Keywords|                            |lto

             Status|UNCONFIRMED                 |ASSIGNED

   Last reconfirmed|                            |2012-12-19

         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org

                   |gnu.org                     |

     Ever Confirmed|0                           |1



--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-19 
10:50:06 UTC ---

Confirmed.  We are writing



#3  0x0000000000bd2802 in write_ts_exp_tree_pointers (ob=0x20b4000, 

    expr=0x7ffff5d99ca0, ref_p=false)

    at /space/rguenther/src/svn/trunk/gcc/tree-streamer-out.c:747

747       stream_write_tree (ob, TREE_BLOCK (expr), ref_p);



of an ADDR_EXPR:



(gdb) call debug_tree (expr)

 <addr_expr 0x7ffff5d99ca0

    type <pointer_type 0x7ffff69380a8

        type <array_type 0x7ffff6938150 type <integer_type 0x7ffff6924930 char>

            BLK

            size <integer_cst 0x7ffff6917940 constant 88>

            unit size <integer_cst 0x7ffff6917960 constant 11>

            align 8 symtab 0 alias set -1 canonical type 0x7ffff69381f8 domain

<integer_type 0x7ffff69382a0>

            pointer_to_this <pointer_type 0x7ffff69380a8>>

        unsigned DI

        size <integer_cst 0x7ffff67e2d20 constant 64>

        unit size <integer_cst 0x7ffff67e2d40 constant 8>

        align 64 symtab 0 alias set -1 canonical type 0x7ffff69380a8>

    readonly constant

    arg 0 <string_cst 0x7ffff5d99cc0 type <array_type 0x7ffff6938150>

        readonly constant static "<lightred>\000">>



but it seems to have been collected.



The ADDR_EXPR is inside a CONSTRUCTOR which is created by switch-conversion:



 <var_decl 0x7ffff316fab0 CSWTCH.1083

    type <array_type 0x7ffff1112d20

        type <pointer_type 0x7ffff65a5150 type <array_type 0x7ffff65a51f8>

            unsigned DI

            size <integer_cst 0x7ffff67e2d20 constant 64>

            unit size <integer_cst 0x7ffff67e2d40 constant 8>

            align 64 symtab 0 alias set -1 canonical type 0x7ffff69380a8>

        BLK

        size <integer_cst 0x7ffff6917900 constant 448>

        unit size <integer_cst 0x7ffff6917b20 constant 56>

        align 64 symtab 0 alias set -1 canonical type 0x7ffff1112d20

        domain <integer_type 0x7ffff693e150 type <integer_type 0x7ffff67f3000

sizetype>

            DI size <integer_cst 0x7ffff67e2d20 64> unit size <integer_cst

0x7ffff67e2d40 8>

            align 64 symtab 0 alias set -1 canonical type 0x7ffff67f3738

precision 64 min <integer_cst 0x7ffff67e2d60 0> max <integer_cst 0x7ffff6917b40

6>>

        pointer_to_this <pointer_type 0x7ffff0e8a150>>

    readonly constant static BLK file output.cc line 1198 col 0 size

<integer_cst 0x7ffff6917900 448> unit size <integer_cst 0x7ffff6917b20 56>

    align 256 initial <constructor 0x7ffff104f360>>



DECL_INITIAL is written via



322       /* Write any LTO-specific data to OB.  */

323       if (DECL_P (expr)

324           && TREE_CODE (expr) != FUNCTION_DECL

325           && TREE_CODE (expr) != TRANSLATION_UNIT_DECL)

326         {

327           /* Handle DECL_INITIAL for symbols.  */

328           tree initial = DECL_INITIAL (expr);

329           if (TREE_CODE (expr) == VAR_DECL

(gdb) l

330               && (TREE_STATIC (expr) || DECL_EXTERNAL (expr))

331               && !DECL_IN_CONSTANT_POOL (expr)

332               && initial)

333             {

334               lto_symtab_encoder_t encoder;

335               struct varpool_node *vnode;

336

337               encoder = ob->decl_state->symtab_node_encoder;

338               vnode = varpool_get_node (expr);

339               if (!vnode

...



so we seem to have an issue with BLOCKs being referenced from DECL_INITIALs

of decls we put into varpool.  The case in question (switch-conversion)

may be the only way this happens, but who knows what frontends do here?



Btw, switch-conversion forgets to unshare the exprs as well.

Reply via email to